pub enum Error<T: Transport, D: Delegate> {
Show 17 variants
NotRunning,
UpdateTimeout,
LeaveTimeout,
Lost(Node<T::Id, T::ResolvedAddress>),
Delegate(DelegateError<D>),
Transport(T::Error),
UnexpectedMessage {
expected: MessageType,
got: MessageType,
},
UnknownMessageType(u8),
SequenceNumberMismatch {
ping: u32,
ack: u32,
},
Encode(EncodeError),
Decode(DecodeError),
Remote(SmolStr),
Multiple(Arc<[Self]>),
Other(Cow<'static, str>),
Encryption(EncryptionError),
Compression(CompressionError),
Checksum(ChecksumError),
}Expand description
Error type for the Memberlist
Variants§
NotRunning
Returns when the node is not running.
UpdateTimeout
Returns when timeout waiting for update broadcast.
LeaveTimeout
Returns when timeout waiting for leave broadcast.
Lost(Node<T::Id, T::ResolvedAddress>)
Returns when lost connection with a peer.
Delegate(DelegateError<D>)
Delegate error
Transport(T::Error)
Transport error
UnexpectedMessage
Returned when a message is received with an unexpected type.
UnknownMessageType(u8)
Returned when receive a unknown message type value
SequenceNumberMismatch
Encode(EncodeError)
Failed to encode message
Decode(DecodeError)
Failed to decode message
Remote(SmolStr)
Returned when a remote error is received.
Multiple(Arc<[Self]>)
Multiple errors
Other(Cow<'static, str>)
Returned when a custom error is created by users.
Encryption(EncryptionError)
Available on crate feature
encryption only.Encryption error
Compression(CompressionError)
Available on crate features
zstd or lz4 or snappy or brotli only.Compressor error
Checksum(ChecksumError)
Available on crate features
crc32 or xxhash64 or xxhash32 or xxhash3 or murmur3 only.Checksum error
Implementations§
Source§impl<T: Transport, D: Delegate> Error<T, D>
impl<T: Transport, D: Delegate> Error<T, D>
Sourcepub fn delegate(e: DelegateError<D>) -> Self
pub fn delegate(e: DelegateError<D>) -> Self
Creates a new error with the given delegate error.
Sourcepub fn sequence_number_mismatch(ping: u32, ack: u32) -> Self
pub fn sequence_number_mismatch(ping: u32, ack: u32) -> Self
Creates a Error::SequenceNumberMismatch error.
Sourcepub fn unexpected_message(expected: MessageType, got: MessageType) -> Self
pub fn unexpected_message(expected: MessageType, got: MessageType) -> Self
Creates a Error::UnexpectedMessage error.
Sourcepub fn remote(e: ErrorResponse) -> Self
pub fn remote(e: ErrorResponse) -> Self
Creates a new error with the given remote error.
Trait Implementations§
Source§impl<T: Transport, D: Delegate> Error for Error<T, D>
impl<T: Transport, D: Delegate> Error for Error<T, D>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl<T: Transport, D: Delegate> From<ChecksumError> for Error<T, D>
impl<T: Transport, D: Delegate> From<ChecksumError> for Error<T, D>
Source§fn from(source: ChecksumError) -> Self
fn from(source: ChecksumError) -> Self
Converts to this type from the input type.
Source§impl<T: Transport, D: Delegate> From<CompressionError> for Error<T, D>
impl<T: Transport, D: Delegate> From<CompressionError> for Error<T, D>
Source§fn from(source: CompressionError) -> Self
fn from(source: CompressionError) -> Self
Converts to this type from the input type.
Source§impl<T: Transport, D: Delegate> From<DecodeError> for Error<T, D>
impl<T: Transport, D: Delegate> From<DecodeError> for Error<T, D>
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl<T: Transport, D: Delegate> From<DelegateError<D>> for Error<T, D>
impl<T: Transport, D: Delegate> From<DelegateError<D>> for Error<T, D>
Source§fn from(source: DelegateError<D>) -> Self
fn from(source: DelegateError<D>) -> Self
Converts to this type from the input type.
Source§impl<T: Transport, D: Delegate> From<EncodeError> for Error<T, D>
impl<T: Transport, D: Delegate> From<EncodeError> for Error<T, D>
Source§fn from(source: EncodeError) -> Self
fn from(source: EncodeError) -> Self
Converts to this type from the input type.
Source§impl<T: Transport, D: Delegate> From<EncryptionError> for Error<T, D>
impl<T: Transport, D: Delegate> From<EncryptionError> for Error<T, D>
Source§fn from(source: EncryptionError) -> Self
fn from(source: EncryptionError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T, D> Freeze for Error<T, D>where
<T as Transport>::Error: Freeze,
<T as Transport>::Id: Freeze,
<T as Transport>::ResolvedAddress: Freeze,
<D as AliveDelegate>::Error: Freeze,
<D as MergeDelegate>::Error: Freeze,
impl<T, D> !RefUnwindSafe for Error<T, D>
impl<T, D> Send for Error<T, D>
impl<T, D> Sync for Error<T, D>
impl<T, D> Unpin for Error<T, D>where
<T as Transport>::Error: Unpin,
<T as Transport>::ResolvedAddress: Unpin,
<D as AliveDelegate>::Error: Unpin,
<D as MergeDelegate>::Error: Unpin,
impl<T, D> !UnwindSafe for Error<T, D>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more