pub enum ProtocolError<E: Debug + Send> {
Custom(E),
Violated,
}
Expand description
When you return closed you must stay closed!
Variants§
Custom(E)
Custom Error on the underlying I/O, e.g. the TCP, UDP or MPSC connection is dropped by the OS
Violated
Violated indicates the veloren_network_protocol was violated the underlying I/O connection is still valid, but the remote side send WRONG (e.g. Invalid, or wrong order) data on the protocol layer.
Trait Implementations§
source§impl<E: Debug + Send> Error for ProtocolError<E>
impl<E: Debug + Send> Error for ProtocolError<E>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<E: Debug + Send> From<ProtocolError<E>> for InitProtocolError<E>
impl<E: Debug + Send> From<ProtocolError<E>> for InitProtocolError<E>
source§fn from(err: ProtocolError<E>) -> Self
fn from(err: ProtocolError<E>) -> Self
Converts to this type from the input type.
source§impl<E: PartialEq + Debug + Send> PartialEq for ProtocolError<E>
impl<E: PartialEq + Debug + Send> PartialEq for ProtocolError<E>
source§fn eq(&self, other: &ProtocolError<E>) -> bool
fn eq(&self, other: &ProtocolError<E>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<E: Eq + Debug + Send> Eq for ProtocolError<E>
impl<E: Debug + Send> StructuralPartialEq for ProtocolError<E>
Auto Trait Implementations§
impl<E> Freeze for ProtocolError<E>where
E: Freeze,
impl<E> RefUnwindSafe for ProtocolError<E>where
E: RefUnwindSafe,
impl<E> Send for ProtocolError<E>
impl<E> Sync for ProtocolError<E>where
E: Sync,
impl<E> Unpin for ProtocolError<E>where
E: Unpin,
impl<E> UnwindSafe for ProtocolError<E>where
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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