pub struct AsyncStreamProcessor<R> { /* private fields */ }Expand description
Async stream processor for handling continuous message streams
Implementations§
Source§impl<R: AsyncRead + Unpin> AsyncStreamProcessor<R>
impl<R: AsyncRead + Unpin> AsyncStreamProcessor<R>
Sourcepub async fn next_message<T: for<'de> Deserialize<'de>>(&mut self) -> Result<T>
pub async fn next_message<T: for<'de> Deserialize<'de>>(&mut self) -> Result<T>
Process the next message from the stream
Sourcepub async fn process_all<T, F, Fut>(&mut self, handler: F) -> Result<()>
pub async fn process_all<T, F, Fut>(&mut self, handler: F) -> Result<()>
Process all messages in the stream
Auto Trait Implementations§
impl<R> Freeze for AsyncStreamProcessor<R>where
R: Freeze,
impl<R> RefUnwindSafe for AsyncStreamProcessor<R>where
R: RefUnwindSafe,
impl<R> Send for AsyncStreamProcessor<R>where
R: Send,
impl<R> Sync for AsyncStreamProcessor<R>where
R: Sync,
impl<R> Unpin for AsyncStreamProcessor<R>where
R: Unpin,
impl<R> UnwindSafe for AsyncStreamProcessor<R>where
R: 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