pub struct StaticSnapshot { /* private fields */ }Expand description
In-memory snapshot source useful in tests and embedders that already hold the snapshot in RAM.
§Examples
use std::sync::Arc;
use dynomite::entropy::send::StaticSnapshot;
use dynomite::entropy::SnapshotSource;
let s = Arc::new(StaticSnapshot::new(b"hello".to_vec()));
assert_eq!(s.snapshot().unwrap(), b"hello");Implementations§
Trait Implementations§
Source§impl SnapshotSource for StaticSnapshot
impl SnapshotSource for StaticSnapshot
Source§fn snapshot(&self) -> EntropyResult<Vec<u8>>
fn snapshot(&self) -> EntropyResult<Vec<u8>>
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. Read moreAuto Trait Implementations§
impl Freeze for StaticSnapshot
impl RefUnwindSafe for StaticSnapshot
impl Send for StaticSnapshot
impl Sync for StaticSnapshot
impl Unpin for StaticSnapshot
impl UnsafeUnpin for StaticSnapshot
impl UnwindSafe for StaticSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more