pub struct Stream<P> { /* private fields */ }Expand description
Handle to one permanent Stream path.
Implementations§
Source§impl<P: StreamProvider> Stream<P>
impl<P: StreamProvider> Stream<P>
Sourcepub const fn path(&self) -> &StreamPath
pub const fn path(&self) -> &StreamPath
Permanent path.
Sourcepub async fn tail(&self) -> Result<u64, StreamError>
pub async fn tail(&self) -> Result<u64, StreamError>
Current tail.
Sourcepub async fn append(
&self,
value: impl Into<Bytes>,
) -> Result<AppendOutcome, StreamError>
pub async fn append( &self, value: impl Into<Bytes>, ) -> Result<AppendOutcome, StreamError>
Unconditionally appends one record.
Sourcepub async fn append_at(
&self,
value: impl Into<Bytes>,
if_tail: u64,
) -> Result<AppendOutcome, StreamError>
pub async fn append_at( &self, value: impl Into<Bytes>, if_tail: u64, ) -> Result<AppendOutcome, StreamError>
Appends one record only at the exact tail.
Sourcepub async fn append_batch(
&self,
records: Vec<Bytes>,
if_tail: Option<u64>,
idempotency_key: Option<IdempotencyKey>,
) -> Result<AppendOutcome, StreamError>
pub async fn append_batch( &self, records: Vec<Bytes>, if_tail: Option<u64>, idempotency_key: Option<IdempotencyKey>, ) -> Result<AppendOutcome, StreamError>
Atomically appends a contiguous batch.
Sourcepub async fn fork(
&self,
destination: impl AsRef<str>,
at_tail: Option<u64>,
idempotency_key: Option<IdempotencyKey>,
) -> Result<ForkReceipt, StreamError>
pub async fn fork( &self, destination: impl AsRef<str>, at_tail: Option<u64>, idempotency_key: Option<IdempotencyKey>, ) -> Result<ForkReceipt, StreamError>
Forks the current or selected retained prefix.
Sourcepub async fn trim(
&self,
before: u64,
idempotency_key: Option<IdempotencyKey>,
) -> Result<TrimReceipt, StreamError>
pub async fn trim( &self, before: u64, idempotency_key: Option<IdempotencyKey>, ) -> Result<TrimReceipt, StreamError>
Monotonically advances the earliest readable sequence.
Sourcepub async fn delete(
&self,
idempotency_key: Option<IdempotencyKey>,
) -> Result<DeleteReceipt, StreamError>
pub async fn delete( &self, idempotency_key: Option<IdempotencyKey>, ) -> Result<DeleteReceipt, StreamError>
Permanently retires this path.
Sourcepub async fn read(
&self,
from: u64,
limit: u32,
) -> Result<RecordStream, StreamError>
pub async fn read( &self, from: u64, limit: u32, ) -> Result<RecordStream, StreamError>
Reads at most limit records from from.
Sourcepub async fn follow(&self, from: u64) -> Result<RecordStream, StreamError>
pub async fn follow(&self, from: u64) -> Result<RecordStream, StreamError>
Replays from from, then remains live.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for Stream<P>where
StreamClient<P>: Freeze,
impl<P> RefUnwindSafe for Stream<P>where
StreamClient<P>: RefUnwindSafe,
impl<P> Send for Stream<P>where
StreamClient<P>: Send,
impl<P> Sync for Stream<P>where
StreamClient<P>: Sync,
impl<P> Unpin for Stream<P>where
StreamClient<P>: Unpin,
impl<P> UnsafeUnpin for Stream<P>where
StreamClient<P>: UnsafeUnpin,
impl<P> UnwindSafe for Stream<P>where
StreamClient<P>: 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
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> 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