pub struct Stream { /* private fields */ }Expand description
A stream of data elements with transformation capabilities.
Implementations§
Source§impl Stream
impl Stream
Sourcepub fn with_config(config: StreamConfig) -> Self
pub fn with_config(config: StreamConfig) -> Self
Create a new stream with custom configuration.
Sourcepub async fn send(&self, message: StreamMessage) -> Result<()>
pub async fn send(&self, message: StreamMessage) -> Result<()>
Send a message to the stream.
Sourcepub async fn recv(&self) -> Result<StreamMessage>
pub async fn recv(&self) -> Result<StreamMessage>
Receive a message from the stream.
Sourcepub fn try_recv(&self) -> Result<Option<StreamMessage>>
pub fn try_recv(&self) -> Result<Option<StreamMessage>>
Try to receive a message without blocking.
Sourcepub async fn last_checkpoint(&self) -> Option<u64>
pub async fn last_checkpoint(&self) -> Option<u64>
Get the last checkpoint ID.
Sourcepub async fn elements_processed(&self) -> u64
pub async fn elements_processed(&self) -> u64
Get the number of elements processed.
Sourcepub async fn bytes_processed(&self) -> u64
pub async fn bytes_processed(&self) -> u64
Get the total bytes processed.
Sourcepub fn sender(&self) -> Sender<StreamMessage>
pub fn sender(&self) -> Sender<StreamMessage>
Get a clone of the sender.
Sourcepub fn receiver(&self) -> Receiver<StreamMessage>
pub fn receiver(&self) -> Receiver<StreamMessage>
Get a clone of the receiver.
Sourcepub fn config(&self) -> &StreamConfig
pub fn config(&self) -> &StreamConfig
Get the stream configuration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stream
impl !RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnsafeUnpin for Stream
impl !UnwindSafe for Stream
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