Struct vapcore_snapshot::service::Service [−][src]
SnapshotService
implementation.
This controls taking snapshots and restoring from them.
Implementations
impl<C> Service<C> where
C: SnapshotClient + ChainInfo,
[src]
C: SnapshotClient + ChainInfo,
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]
&self,
manifest: ManifestData,
recover: bool
) -> Result<(), Error>
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]
fn manifest(&self) -> Option<ManifestData>
[src]
fn supported_versions(&self) -> Option<(u64, u64)>
[src]
fn completed_chunks(&self) -> Option<Vec<H256>>
[src]
fn chunk(&self, hash: H256) -> Option<Bytes>
[src]
fn status(&self) -> RestorationStatus
[src]
fn begin_restore(&self, manifest: ManifestData)
[src]
fn abort_restore(&self)
[src]
fn restore_state_chunk(&self, hash: H256, chunk: Bytes)
[src]
fn restore_block_chunk(&self, hash: H256, chunk: Bytes)
[src]
fn abort_snapshot(&self)
[src]
fn shutdown(&self)
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,