pub struct CompactionStore { /* private fields */ }Expand description
Manages compaction files in a directory.
Files are named compaction_<through_seq>.json where through_seq is the
last memory sequence number included in that compaction.
Implementations§
Source§impl CompactionStore
impl CompactionStore
pub fn new(directory: PathBuf) -> Self
Sourcepub fn find_latest(&self) -> Result<Option<Compaction>>
pub fn find_latest(&self) -> Result<Option<Compaction>>
Find the latest compaction by scanning for the highest sequence number.
Sourcepub fn save(&self, compaction: &Compaction) -> Result<()>
pub fn save(&self, compaction: &Compaction) -> Result<()>
Save a compaction to disk.
Sourcepub fn read(&self, through_seq: u64) -> Result<Compaction>
pub fn read(&self, through_seq: u64) -> Result<Compaction>
Read a specific compaction by its through_seq.
pub fn directory(&self) -> &Path
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompactionStore
impl RefUnwindSafe for CompactionStore
impl Send for CompactionStore
impl Sync for CompactionStore
impl Unpin for CompactionStore
impl UnwindSafe for CompactionStore
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreCreates a shared type from an unshared type.