# Struct ethcore::snapshot::service::Service [−] [src]

    pub struct Service { /* fields omitted */ }

`SnapshotService` implementation. This controls taking snapshots and restoring from them.

## Methods

### `impl Service`
[src]

#### `fn new(params: ServiceParams) -> Result<Self, Error>`

Create a new snapshot service from the given parameters.

#### `fn reader(&self) -> RwLockReadGuard<Option<LooseReader>>`

Get a reference to the snapshot reader.

#### `fn tick(&self)`

Tick the snapshot service. This will log any active snapshot being taken.

#### `fn take_snapshot(&self, client: &Client, num: u64) -> Result<(), Error>`

Take a snapshot at the block with the given number. calling this while a restoration is in progress or vice versa will lead to a race condition where the first one to finish will have their produced snapshot overwritten.

#### `fn init_restore(&self,
manifest: ManifestData,
recover: bool)
-> Result<(), Error>`

Initialize the restoration synchronously. The recover flag indicates whether to recover the restored snapshot.

#### `fn feed_state_chunk(&self, hash: H256, chunk: &[u8])`

Feed a state chunk to be processed synchronously.

#### `fn feed_block_chunk(&self, hash: H256, chunk: &[u8])`

Feed a block chunk to be processed synchronously.

## Trait Implementations

### `impl SnapshotService for Service`
[src]

#### `fn manifest(&self) -> Option<ManifestData>`

Query the most recent manifest data.

#### `fn chunk(&self, hash: H256) -> Option<Bytes>`

Get raw chunk for a given hash.

#### `fn status(&self) -> RestorationStatus`

Ask the snapshot service for the restoration status.

#### `fn begin_restore(&self, manifest: ManifestData)`

Begin snapshot restoration. If restoration in-progress, this will reset it. From this point on, any previous snapshot may become unavailable. Read more

#### `fn abort_restore(&self)`

Abort an in-progress restoration if there is one.

#### `fn restore_state_chunk(&self, hash: H256, chunk: Bytes)`

Feed a raw state chunk to the service to be processed asynchronously. no-op if not currently restoring. Read more

#### `fn restore_block_chunk(&self, hash: H256, chunk: Bytes)`

Feed a raw block chunk to the service to be processed asynchronously. no-op if currently restoring. Read more

#### `fn provide_canon_hashes(&self, canonical: &[(u64, H256)])`

Give the restoration in-progress some canonical block hashes for extra verification (performed at the end) Read more

### `impl Drop for Service`
[src]

#### `fn drop(&mut self)`

A method called when the value goes out of scope. Read more

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