pub struct WsStream<T: WsStreamTrait<E>, E>(/* private fields */);Expand description
Wrapper for types implementing WsStreamTrait.
This type is used to avoid the orphan rule. Exposed for stream type construction.
Implementations§
Trait Implementations§
Source§impl<T, E> UnderlyingStream<RetryContext, Result<Packet, StreamError<E>>, StreamError<E>> for WsStream<T, E>where
T: WsStreamTrait<E>,
E: Error,
impl<T, E> UnderlyingStream<RetryContext, Result<Packet, StreamError<E>>, StreamError<E>> for WsStream<T, E>where
T: WsStreamTrait<E>,
E: Error,
type Stream = <T as WsStreamTrait<E>>::Stream
Source§fn establish(
ctor_arg: RetryContext,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream, StreamError<E>>>>>
fn establish( ctor_arg: RetryContext, ) -> Pin<Box<dyn Future<Output = Result<Self::Stream, StreamError<E>>>>>
The creation function is used by ReconnectStream in order to establish both the initial IO connection
in addition to performing reconnects.
Source§fn is_write_disconnect_error(err: &StreamError<E>) -> bool
fn is_write_disconnect_error(err: &StreamError<E>) -> bool
When sink send experience an
Error during operation, it does not necessarily mean
it is a disconnect/termination (ex: WouldBlock).
You may specify which errors are considered “disconnects” by this method.Source§fn is_read_disconnect_error(item: &Result<Packet, StreamError<E>>) -> bool
fn is_read_disconnect_error(item: &Result<Packet, StreamError<E>>) -> bool
It’s common practice for Stream implementations that return an
Err
when there’s an error.
You may match the result to tell them apart from normal response.
By default, no response is considered a “disconnect”.Source§fn exhaust_err() -> StreamError<E>
fn exhaust_err() -> StreamError<E>
This is returned when retry quota exhausted.
Auto Trait Implementations§
impl<T, E> Freeze for WsStream<T, E>
impl<T, E> RefUnwindSafe for WsStream<T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for WsStream<T, E>
impl<T, E> Sync for WsStream<T, E>
impl<T, E> Unpin for WsStream<T, E>
impl<T, E> UnwindSafe for WsStream<T, E>where
T: UnwindSafe,
E: 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