pub struct SnapshotWriter { /* private fields */ }Expand description
Writes snapshots of a SharedGraph to disk in HLSS format.
Implementations§
Source§impl SnapshotWriter
impl SnapshotWriter
pub fn new(dir: PathBuf, max_snapshots: usize) -> Self
pub fn with_compression(self, level: i32) -> Self
Sourcepub fn write(&self, graph: &SharedGraph) -> Result<PathBuf, SnapshotError>
pub fn write(&self, graph: &SharedGraph) -> Result<PathBuf, SnapshotError>
Write a snapshot of the graph. Returns path to the snapshot file. Uses atomic write: write to temp file, then rename.
Sourcepub fn rotate(&self) -> Result<usize, SnapshotError>
pub fn rotate(&self) -> Result<usize, SnapshotError>
Remove old snapshots beyond max_snapshots. Returns number removed.
Auto Trait Implementations§
impl Freeze for SnapshotWriter
impl RefUnwindSafe for SnapshotWriter
impl Send for SnapshotWriter
impl Sync for SnapshotWriter
impl Unpin for SnapshotWriter
impl UnsafeUnpin for SnapshotWriter
impl UnwindSafe for SnapshotWriter
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more