pub struct TailLog<T> { /* private fields */ }Expand description
An append-only event log with terminal state and parked tail reads.
Implementations§
Source§impl<T: Clone> TailLog<T>
impl<T: Clone> TailLog<T>
Sourcepub fn push(&self, event: T) -> bool
pub fn push(&self, event: T) -> bool
Append an event and wake parked readers.
Returns false (dropping the event) if the log is already finished.
Sourcepub fn snapshot_from(&self, seq: u64) -> TailPage<T>
pub fn snapshot_from(&self, seq: u64) -> TailPage<T>
Non-blocking snapshot of the tail from seq.
Sourcepub async fn read_from(&self, seq: u64) -> TailPage<T>
pub async fn read_from(&self, seq: u64) -> TailPage<T>
Atomic tail read: park until there are events past seq or the log
is finished, then return them together with the terminal status.
Sourcepub async fn read_from_cancellable(
&self,
seq: u64,
token: &CancelToken,
) -> Result<TailPage<T>, Cancelled>
pub async fn read_from_cancellable( &self, seq: u64, token: &CancelToken, ) -> Result<TailPage<T>, Cancelled>
TailLog::read_from, cancellable.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for TailLog<T>
impl<T> RefUnwindSafe for TailLog<T>where
Mutex<TailState<T>>: RefUnwindSafe,
impl<T> Send for TailLog<T>
impl<T> Sync for TailLog<T>
impl<T> Unpin for TailLog<T>
impl<T> UnsafeUnpin for TailLog<T>where
Mutex<TailState<T>>: UnsafeUnpin,
impl<T> UnwindSafe for TailLog<T>where
Mutex<TailState<T>>: UnwindSafe,
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