pub struct BinaryStore { /* private fields */ }Implementations§
Source§impl BinaryStore
impl BinaryStore
pub const fn path(&self) -> &PathBuf
pub fn new(path: &Path) -> Result<Self>
Sourcepub fn new_with_slot(
path: &Path,
slot: Option<Arc<ArcSwap<File>>>,
) -> Result<Self>
pub fn new_with_slot( path: &Path, slot: Option<Arc<ArcSwap<File>>>, ) -> Result<Self>
Open (or create) the log. When slot is Some, the freshly opened file
handle is published into that existing shared cell instead of a new one —
this is how compact keeps the background sync thread pointed at the
post-compaction file rather than the renamed-away original (D1).
pub fn write_record(&mut self, kind: RecordKind, payload: &[u8]) -> Result<()>
pub fn flush_and_sync(&mut self) -> Result<()>
pub fn replay<F>(&self, callback: F) -> Result<()>
pub fn close(&mut self) -> Result<()>
Sourcepub fn reopen_truncated(&mut self) -> Result<()>
pub fn reopen_truncated(&mut self) -> Result<()>
Reopen the file with truncation — discards all existing records.
Used by compact to rewrite a fresh log from in-memory state.
Auto Trait Implementations§
impl Freeze for BinaryStore
impl RefUnwindSafe for BinaryStore
impl Send for BinaryStore
impl Sync for BinaryStore
impl Unpin for BinaryStore
impl UnsafeUnpin for BinaryStore
impl UnwindSafe for BinaryStore
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