pub struct RetryContext { /* private fields */ }Expand description
Internal context for server picking during (re)connection.
Implements a round-robin policy for server selection.
Implementations§
Source§impl RetryContext
impl RetryContext
Trait Implementations§
Source§impl Clone for RetryContext
impl Clone for RetryContext
Source§fn clone(&self) -> RetryContext
fn clone(&self) -> RetryContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RetryContext
impl Debug for RetryContext
Source§impl From<StreamConfig> for RetryContext
impl From<StreamConfig> for RetryContext
Source§fn from(config: StreamConfig) -> Self
fn from(config: StreamConfig) -> Self
Converts to this type from the input type.
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 Freeze for RetryContext
impl RefUnwindSafe for RetryContext
impl Send for RetryContext
impl Sync for RetryContext
impl Unpin for RetryContext
impl UnwindSafe for RetryContext
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