pub struct MemLog { /* private fields */ }Expand description
Primary in-memory implementation (also the dev/test runtime).
Implementations§
Trait Implementations§
Source§impl OpLog for MemLog
impl OpLog for MemLog
Source§fn sync(&mut self) -> Result<(), LogError>
fn sync(&mut self) -> Result<(), LogError>
Nothing to do: a MemLog never outlives its process, so there is
no weaker state for sync to strengthen. The default would serve;
it is spelled out because “in-memory logs cannot be made durable”
is the reason, not an oversight.
Source§fn append(&mut self, entry: OpEntry) -> Result<ContentHash, LogError>
fn append(&mut self, entry: OpEntry) -> Result<ContentHash, LogError>
Appends
entry and returns its content hash (the new head). Read moreSource§fn head(&self) -> Option<ContentHash>
fn head(&self) -> Option<ContentHash>
Content hash of the newest entry, or
None for an empty log.Auto Trait Implementations§
impl Freeze for MemLog
impl RefUnwindSafe for MemLog
impl Send for MemLog
impl Sync for MemLog
impl Unpin for MemLog
impl UnsafeUnpin for MemLog
impl UnwindSafe for MemLog
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