pub struct Streamer<M> { /* private fields */ }
Available on crate feature
feature
only.Implementations§
Source§impl<M> Streamer<M>
impl<M> Streamer<M>
Sourcepub async fn send(&mut self, data: M) -> Result<(), StreamError>where
M: Serialize,
pub async fn send(&mut self, data: M) -> Result<(), StreamError>where
M: Serialize,
§Panics
If you call this when the Stream::KIND is not Receiver
Sourcepub async fn closed(&self)
pub async fn closed(&self)
Completes when the receiver has dropped.
§Panics
If you call this when the Stream::KIND is not Receiver
Sourcepub async fn recv(&mut self) -> Result<M, StreamError>where
M: DeserializeOwned,
pub async fn recv(&mut self) -> Result<M, StreamError>where
M: DeserializeOwned,
§Panics
If you call this when the Stream::KIND is not Sender
Trait Implementations§
Source§impl<'a, R, M> Extractor<'a, R> for Streamer<M>where
M: Send + 'static,
impl<'a, R, M> Extractor<'a, R> for Streamer<M>where
M: Send + 'static,
type Error = Infallible
type Prepared = Streamer<M>
fn validate(validate: Validate<'_>)
fn prepare( prepare: Prepare<'_>, ) -> Pin<Box<dyn Future<Output = Result<Self::Prepared, Self::Error>> + Send + '_>>
fn extract(
extract: Extract<'a, '_, Self::Prepared, R>,
) -> Result<Self, Self::Error>where
Self: Sized,
Auto Trait Implementations§
impl<M> Freeze for Streamer<M>
impl<M> RefUnwindSafe for Streamer<M>where
M: RefUnwindSafe,
impl<M> Send for Streamer<M>where
M: Send,
impl<M> Sync for Streamer<M>where
M: Sync,
impl<M> Unpin for Streamer<M>where
M: Unpin,
impl<M> UnwindSafe for Streamer<M>where
M: 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