pub struct History { /* private fields */ }Expand description
Where one VM’s history is appended.
Implementations§
Source§impl History
impl History
Sourcepub fn from_store(
vm_id: &str,
store: Arc<dyn RunStore>,
clock: Arc<dyn Clock>,
) -> History
pub fn from_store( vm_id: &str, store: Arc<dyn RunStore>, clock: Arc<dyn Clock>, ) -> History
The history for vm_id, using the supplied store and wall clock.
A subdirectory rather than the root itself, so ledger::read_all’s *.json glob and
this module’s files can never be confused for one another by a tool listing the
state directory.
Sourcepub fn append(&self, event: Event)
pub fn append(&self, event: Event)
Appends one event. Failures are swallowed.
Deliberately, and for the ledger’s reason: this runs on teardown paths, and a history write that raised would replace the caller’s real failure with a filesystem one. The values are still in the envelope; only the durable record is lost.
seq is the current line count — see the module docs on the single-writer
assumption that makes counting sufficient.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for History
impl !UnwindSafe for History
impl Freeze for History
impl Send for History
impl Sync for History
impl Unpin for History
impl UnsafeUnpin for History
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.