pub struct FileTransitionLog<T: LinkReference> { /* private fields */ }Expand description
A versioned, checksummed append-only file journal.
Every append uses sync_all. Opening validates every complete record and
removes a torn final line before further appends. Corrupt complete records
and addresses too wide for the requested T are errors, never skipped.
Creating a new file requires its parent directory to exist; synchronize that
directory before relying on a newly created path surviving a system crash.
File locking and retention are the caller’s responsibility.
Implementations§
Source§impl<T: LinkReference> FileTransitionLog<T>
impl<T: LinkReference> FileTransitionLog<T>
Trait Implementations§
Source§impl<T: Debug + LinkReference> Debug for FileTransitionLog<T>
impl<T: Debug + LinkReference> Debug for FileTransitionLog<T>
Source§impl<T: LinkReference> TransitionLog<T> for FileTransitionLog<T>
impl<T: LinkReference> TransitionLog<T> for FileTransitionLog<T>
Source§fn read_entries(&mut self) -> Result<Vec<JournalEntry<T>>>
fn read_entries(&mut self) -> Result<Vec<JournalEntry<T>>>
Reads all complete records in append order.
Auto Trait Implementations§
impl<T> Freeze for FileTransitionLog<T>where
PhantomData<T>: Freeze,
impl<T> RefUnwindSafe for FileTransitionLog<T>where
PhantomData<T>: RefUnwindSafe,
impl<T> Send for FileTransitionLog<T>where
PhantomData<T>: Send,
impl<T> Sync for FileTransitionLog<T>where
PhantomData<T>: Sync,
impl<T> Unpin for FileTransitionLog<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for FileTransitionLog<T>where
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for FileTransitionLog<T>where
PhantomData<T>: UnwindSafe,
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