# Struct ethcore::snapshot::Watcher [−] [src]

    pub struct Watcher { /* fields omitted */ }

A `ChainNotify` implementation which will trigger a snapshot event at certain block numbers.

## Methods

### `impl Watcher`
[src]

#### `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

### `impl ChainNotify for Watcher`
[src]

#### `fn new_blocks(&self,
imported: Vec<H256>,
_: Vec<H256>,
_: Vec<H256>,
_: Vec<H256>,
_: Vec<H256>,
_: Vec<Bytes>,
_duration: u64)`

fires when chain has new blocks.

#### `fn start(&self)`

fires when chain achieves active mode

#### `fn stop(&self)`

fires when chain achieves passive mode

#### `fn broadcast(&self, _data: Vec<u8>)`

fires when chain broadcasts a message

#### `fn transactions_received(&self, _hashes: Vec<H256>, _peer_id: usize)`

fires when new transactions are received from a peer

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)