pub struct ExternalDurableStream<T> { /* private fields */ }Expand description
A single-reader, one-batch-buffered external source. &mut self serializes reads.
A delivered batch is drained before its opaque checkpoint is promoted.
Dropping a pending next cancels that attempt without advancing the checkpoint.
Live readers are reconstructed by replay, not serialized as native stream handles.
Implementations§
Source§impl<T: DeserializeOwned> ExternalDurableStream<T>
impl<T: DeserializeOwned> ExternalDurableStream<T>
pub fn json(url: impl Into<String>, options: ReadOptions) -> Self
Source§impl ExternalDurableStream<u8>
impl ExternalDurableStream<u8>
Sourcepub fn bytes(url: impl Into<String>, options: ReadOptions) -> Self
pub fn bytes(url: impl Into<String>, options: ReadOptions) -> Self
Bytes are a sequence, not the original append chunk boundaries.
Source§impl<T> ExternalDurableStream<T>
impl<T> ExternalDurableStream<T>
Sourcepub fn checkpoint(&self) -> &Checkpoint
pub fn checkpoint(&self) -> &Checkpoint
Last fully drained checkpoint. A partially consumed batch retains its original offset.
Sourcepub fn close(&mut self)
pub fn close(&mut self)
Stop pulling and discard buffered items. To cancel an active pull, drop its future first.
pub async fn next(&mut self) -> Result<Option<T>, Error>
pub async fn collect(self) -> Result<Vec<T>, Error>
Auto Trait Implementations§
impl<T> !Freeze for ExternalDurableStream<T>
impl<T> RefUnwindSafe for ExternalDurableStream<T>
impl<T> Send for ExternalDurableStream<T>
impl<T> Sync for ExternalDurableStream<T>
impl<T> Unpin for ExternalDurableStream<T>
impl<T> UnsafeUnpin for ExternalDurableStream<T>
impl<T> UnwindSafe for ExternalDurableStream<T>
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