pub struct RequestStream<S> { /* 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>
impl<S, T, E> RequestStream<S>
pub fn new(stream: S) -> Self
pub fn with_codec(stream: S, codec: Codec) -> Self
pub fn inner_mut(&mut self) -> &mut S
pub fn codec_mut(&mut self) -> &mut Codec
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>
impl<S, T, E> Stream for RequestStream<S>
impl<'__pin, S> Unpin for RequestStream<S>where
PinnedFieldsOf<__Origin<'__pin, S>>: Unpin,
Auto Trait Implementations§
impl<S> Freeze for RequestStream<S>where
S: Freeze,
impl<S> RefUnwindSafe for RequestStream<S>where
S: RefUnwindSafe,
impl<S> Send for RequestStream<S>where
S: Send,
impl<S> Sync for RequestStream<S>where
S: Sync,
impl<S> UnwindSafe for RequestStream<S>where
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