pub struct VersionedEventLog { /* private fields */ }Expand description
A JSONL event log that accepts legacy bare events and version-zero envelopes.
Implementations§
Source§impl VersionedEventLog
impl VersionedEventLog
pub fn open(path: impl Into<PathBuf>) -> Self
pub fn path(&self) -> &Path
Sourcepub fn append(&self, event: &AgentEvent) -> Result<(), PersistenceError>
pub fn append(&self, event: &AgentEvent) -> Result<(), PersistenceError>
Append one current-schema envelope.
Sourcepub fn read(&self) -> Result<Vec<AgentEvent>, PersistenceError>
pub fn read(&self) -> Result<Vec<AgentEvent>, PersistenceError>
Read all events. Missing logs are an empty event stream.
pub fn read_with_versions(&self) -> Result<LoadedEvents, PersistenceError>
Sourcepub fn migrate_in_place(&self) -> Result<MigrationReport, PersistenceError>
pub fn migrate_in_place(&self) -> Result<MigrationReport, PersistenceError>
Rewrite legacy records atomically. A malformed record leaves the source untouched, allowing an operator to repair the bad log manually.
Trait Implementations§
Source§impl Clone for VersionedEventLog
impl Clone for VersionedEventLog
Source§fn clone(&self) -> VersionedEventLog
fn clone(&self) -> VersionedEventLog
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VersionedEventLog
impl RefUnwindSafe for VersionedEventLog
impl Send for VersionedEventLog
impl Sync for VersionedEventLog
impl Unpin for VersionedEventLog
impl UnsafeUnpin for VersionedEventLog
impl UnwindSafe for VersionedEventLog
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