Skip to main content

SnapshotSource

Trait SnapshotSource 

Source
pub trait SnapshotSource: Send + Sync {
    // Required method
    fn snapshot(&self) -> Result<Vec<u8>, EntropyError>;
}
Expand description

Snapshot byte source.

Implementations are typically pluggable via the Stage 13 embedding API; the engine ships RedisLocalSnapshot as the default. Implementations are expected to be cheap to clone (e.g. shared via Arc) but each call to snapshot may produce a different blob.

Required Methods§

Source

fn snapshot(&self) -> Result<Vec<u8>, EntropyError>

Produce one snapshot of the local state as a contiguous byte buffer. The sender treats the bytes as opaque; the receiver replays them through its SnapshotSink.

§Errors

Implementation-defined.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> SnapshotSource for Arc<T>
where T: SnapshotSource + ?Sized,

Implementors§