pub struct JournalWriterHandle { /* private fields */ }Expand description
A cheap, cloneable handle to a JournalWriter.
Cloning shares the same underlying channel; the writer stops once the last handle is dropped.
Implementations§
Source§impl JournalWriterHandle
impl JournalWriterHandle
Sourcepub fn append_buffered(&self, entry: JournalEntry)
pub fn append_buffered(&self, entry: JournalEntry)
Enqueue a buffered, fire-and-forget append.
Returns immediately. On a full channel the entry is dropped with a WARN (acceptable for
Idempotent/AtLeastOnce effects, which re-run safely on resume); on a stopped writer it is
likewise dropped. Use append_acked when durability-on-return matters.
Sourcepub async fn append_acked(
&self,
entry: JournalEntry,
) -> Result<JournalSeq, DurableError>
pub async fn append_acked( &self, entry: JournalEntry, ) -> Result<JournalSeq, DurableError>
Append an exactly-once entry and await its committed JournalSeq.
The writer flushes all causally-preceding buffered entries before committing this one
(INV-4). The whole round-trip is bounded by journal_ack_timeout_ms.
§Errors
Returns DurableError::JournalUnavailable if the writer does not acknowledge within the
timeout or is unreachable, and propagates a backend DurableError if the commit itself
fails. The caller never blocks indefinitely (INV-12).
Sourcepub async fn flush(&self) -> Result<(), DurableError>
pub async fn flush(&self) -> Result<(), DurableError>
Drain all buffered entries to the database and await confirmation — a turn-boundary barrier.
§Errors
Returns DurableError::JournalUnavailable if the writer does not confirm within the
timeout or is unreachable.
Trait Implementations§
Source§impl Clone for JournalWriterHandle
impl Clone for JournalWriterHandle
Source§fn clone(&self) -> JournalWriterHandle
fn clone(&self) -> JournalWriterHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for JournalWriterHandle
impl RefUnwindSafe for JournalWriterHandle
impl Send for JournalWriterHandle
impl Sync for JournalWriterHandle
impl Unpin for JournalWriterHandle
impl UnsafeUnpin for JournalWriterHandle
impl UnwindSafe for JournalWriterHandle
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
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>
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>
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 more