Struct vapcore_snapshot::service::Service[][src]

pub struct Service<C: Send + Sync + 'static> { /* fields omitted */ }

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

Implementations

impl<C> Service<C> where
    C: SnapshotClient + ChainInfo
[src]

pub fn new(params: ServiceParams<C>) -> Result<Self, Error>[src]

Create a new snapshot service from the given parameters.

pub fn reader(&self) -> RwLockReadGuard<'_, Option<LooseReader>>[src]

Get a reference to the snapshot reader.

pub fn tick(&self)[src]

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

pub fn take_snapshot(&self, client: &C, num: u64) -> Result<(), Error>[src]

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.

pub fn init_restore(
    &self,
    manifest: ManifestData,
    recover: bool
) -> Result<(), Error>
[src]

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

pub fn feed_state_chunk(&self, hash: H256, chunk: &[u8])[src]

Feed a state chunk to be processed synchronously.

pub fn feed_block_chunk(&self, hash: H256, chunk: &[u8])[src]

Feed a block chunk to be processed synchronously.

Trait Implementations

impl<C: Send + Sync> Drop for Service<C>[src]

impl<C: Send + Sync> SnapshotService for Service<C>[src]

Auto Trait Implementations

impl<C> !RefUnwindSafe for Service<C>

impl<C> Send for Service<C>

impl<C> Sync for Service<C>

impl<C> Unpin for Service<C>

impl<C> !UnwindSafe for Service<C>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,