Struct http_ws::stream::RequestStream
source · pub struct RequestStream<S, E> { /* private fields */ }Expand description
Decode S type into Stream of websocket Message.
S type must impl Stream trait and output Result<T, E> as Stream::Item
where T type impl AsRef<[u8]> trait. (&[u8] is needed for parsing messages)
Implementations§
source§impl<S, T, E> RequestStream<S, E>
impl<S, T, E> RequestStream<S, E>
pub fn new(stream: S) -> Self
pub fn with_codec(stream: S, codec: Codec) -> Self
sourcepub fn response_stream(&self) -> (ResponseStream, ResponseSender)
pub fn response_stream(&self) -> (ResponseStream, ResponseSender)
Make a ResponseStream from current DecodeStream.
This API is to share the same codec for both decode and encode stream.
Trait Implementations§
source§impl<S, T, E> Stream for RequestStream<S, E>
impl<S, T, E> Stream for RequestStream<S, E>
impl<'__pin, S, E> Unpin for RequestStream<S, E>where
__Origin<'__pin, S, E>: Unpin,
Auto Trait Implementations§
impl<S, E> RefUnwindSafe for RequestStream<S, E>where
E: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, E> Send for RequestStream<S, E>
impl<S, E> Sync for RequestStream<S, E>
impl<S, E> UnwindSafe for RequestStream<S, E>where
E: UnwindSafe,
S: 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