pub struct Stream<T> { /* private fields */ }Expand description
Defines a typed best-effort resumable message Stream owned by one Flow type.
Register the same definition in exactly one crate::PersistenceSchema. Clones share
identity and may be used at Client and Step call sites.
Implementations§
Source§impl<T> Stream<T>
impl<T> Stream<T>
Sourcepub fn new(name: impl Into<String>, max_estimated_bytes: i64) -> Self
pub fn new(name: impl Into<String>, max_estimated_bytes: i64) -> Self
Creates a Stream with a positive approximate budget shared by all instances of its Flow.
§Panics
Panics when name is empty or max_estimated_bytes is not positive.
Sourcepub fn max_estimated_bytes(&self) -> i64
pub fn max_estimated_bytes(&self) -> i64
Returns the approximate shared byte budget.
Sourcepub fn write(&self, context: &mut Context, value: T) -> HandlerResult<()>where
T: Value,
pub fn write(&self, context: &mut Context, value: T) -> HandlerResult<()>where
T: Value,
Appends one message immediately from the current Step execution.
§Errors
Returns crate::HandlerError for RPC Contexts, duplicate writes, unregistered Streams,
encoding failures, or a failed FlowService write.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Stream<T>
impl<T> RefUnwindSafe for Stream<T>
impl<T> Send for Stream<T>
impl<T> Sync for Stream<T>
impl<T> Unpin for Stream<T>
impl<T> UnsafeUnpin for Stream<T>
impl<T> UnwindSafe for Stream<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
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