pub struct JsonlEventLog { /* private fields */ }Expand description
Crash-durable JSONL log containing complete canonical Event envelopes.
An append is acknowledged only after newline-delimited bytes are flushed and
sync_data succeeds. A torn final record is an uncommitted tail and is
truncated on open; any malformed complete line is corruption. The in-memory
index is disposable and rebuilt solely from the canonical log.
Implementations§
Source§impl JsonlEventLog
impl JsonlEventLog
Sourcepub async fn open(
path: impl AsRef<Path>,
) -> Result<JsonlEventLog, EventLogError>
pub async fn open( path: impl AsRef<Path>, ) -> Result<JsonlEventLog, EventLogError>
Open or create a canonical event JSONL file and rebuild its index.
Trait Implementations§
Source§impl EventLog for JsonlEventLog
impl EventLog for JsonlEventLog
Source§fn append<'life0, 'async_trait>(
&'life0 self,
request: EventRequest,
) -> Pin<Box<dyn Future<Output = Result<Event, EventLogError>> + Send + 'async_trait>>where
'life0: 'async_trait,
JsonlEventLog: 'async_trait,
fn append<'life0, 'async_trait>(
&'life0 self,
request: EventRequest,
) -> Pin<Box<dyn Future<Output = Result<Event, EventLogError>> + Send + 'async_trait>>where
'life0: 'async_trait,
JsonlEventLog: 'async_trait,
Commit a durable request, assigning its event id and persisted sequence.
Source§fn durability(&self) -> EventDurability
fn durability(&self) -> EventDurability
Persistence guarantee used for acknowledged appends.
Source§impl EventReader for JsonlEventLog
impl EventReader for JsonlEventLog
Source§fn read_page<'life0, 'async_trait>(
&'life0 self,
request: EventReadRequest,
) -> Pin<Box<dyn Future<Output = Result<EventPage, EventLogError>> + Send + 'async_trait>>where
'life0: 'async_trait,
JsonlEventLog: 'async_trait,
fn read_page<'life0, 'async_trait>(
&'life0 self,
request: EventReadRequest,
) -> Pin<Box<dyn Future<Output = Result<EventPage, EventLogError>> + Send + 'async_trait>>where
'life0: 'async_trait,
JsonlEventLog: 'async_trait,
Read one page. The first page fixes a snapshot high-watermark; continuations
cannot observe concurrent appends and therefore neither skip nor duplicate.
Auto Trait Implementations§
impl !Freeze for JsonlEventLog
impl !RefUnwindSafe for JsonlEventLog
impl !UnwindSafe for JsonlEventLog
impl Send for JsonlEventLog
impl Sync for JsonlEventLog
impl Unpin for JsonlEventLog
impl UnsafeUnpin for JsonlEventLog
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request