pub struct Watcher { /* private fields */ }
Expand description
A ChainNotify
implementation which will trigger a snapshot event
at certain block numbers.
Implementations
sourceimpl Watcher
impl Watcher
sourcepub fn new<F>(
client: Arc<Client>,
sync_status: F,
channel: IoChannel<ClientIoMessage>,
period: u64,
history: u64
) -> Self where
F: 'static + Send + Sync + Fn() -> bool,
pub fn new<F>(
client: Arc<Client>,
sync_status: F,
channel: IoChannel<ClientIoMessage>,
period: u64,
history: u64
) -> Self where
F: 'static + Send + Sync + Fn() -> bool,
Create a new Watcher
which will trigger a snapshot event
once every period
blocks, but only after that block is
history
blocks old.
Trait Implementations
sourceimpl ChainNotify for Watcher
impl ChainNotify for Watcher
sourcefn new_blocks(&self, new_blocks: NewBlocks)
fn new_blocks(&self, new_blocks: NewBlocks)
fires when chain has new blocks.
sourcefn broadcast(&self, _message_type: ChainMessageType)
fn broadcast(&self, _message_type: ChainMessageType)
fires when chain broadcasts a message
sourcefn block_pre_import(&self, _bytes: &Bytes, _hash: &H256, _difficulty: &U256)
fn block_pre_import(&self, _bytes: &Bytes, _hash: &H256, _difficulty: &U256)
fires when new block is about to be imported implementations should be light Read more
sourcefn transactions_received(&self, _txs: &[UnverifiedTransaction], _peer_id: usize)
fn transactions_received(&self, _txs: &[UnverifiedTransaction], _peer_id: usize)
fires when new transactions are received from a peer
Auto Trait Implementations
impl !RefUnwindSafe for Watcher
impl Send for Watcher
impl Sync for Watcher
impl Unpin for Watcher
impl !UnwindSafe for Watcher
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more