pub struct EventLog { /* private fields */ }Expand description
Append-only binary event log, one file per (symbol, stream_kind).
Implementations§
Source§impl EventLog
impl EventLog
Sourcepub fn new(root: impl Into<PathBuf>) -> Result<Self>
pub fn new(root: impl Into<PathBuf>) -> Result<Self>
Create an EventLog rooted at root. Creates the directory if absent.
Sourcepub fn append(
&self,
symbol: &str,
stream_kind: &str,
record: &EventRecord<'_>,
) -> Result<()>
pub fn append( &self, symbol: &str, stream_kind: &str, record: &EventRecord<'_>, ) -> Result<()>
Append one record to {symbol}/{stream_kind}.bin.
Creates subdirectory and file on first call.
Sourcepub fn read_all(
&self,
symbol: &str,
stream_kind: &str,
) -> Result<Vec<(i64, Vec<u8>)>>
pub fn read_all( &self, symbol: &str, stream_kind: &str, ) -> Result<Vec<(i64, Vec<u8>)>>
Read all records from {symbol}/{stream_kind}.bin.
Returns (ts_ms, payload_bytes) pairs. Truncated tail records are
silently skipped (truncation-safe).
Auto Trait Implementations§
impl Freeze for EventLog
impl RefUnwindSafe for EventLog
impl Send for EventLog
impl Sync for EventLog
impl Unpin for EventLog
impl UnsafeUnpin for EventLog
impl UnwindSafe for EventLog
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