Enum async_proto::ReadErrorKind
source · pub enum ReadErrorKind {
Show 17 variants
BufSize(TryFromIntError),
Custom(String),
EndOfStream,
FloatNotFinite,
MessageKind(Message),
ReadNever,
TryReserve(TryReserveError),
UnknownVariant8(u8),
UnknownVariant16(u16),
UnknownVariant32(u32),
UnknownVariant64(u64),
UnknownVariant128(u128),
WebSocketTextMessage(Option<char>),
Io(Error),
ParseInt(ParseIntError),
Tungstenite(Error),
Utf8(FromUtf8Error),
}Expand description
Specifies what went wrong while reading (receiving) a value.
Variants§
BufSize(TryFromIntError)
Received a buffer with more than usize::MAX elements
Custom(String)
An error variant you can use when manually implementing Protocol
EndOfStream
The end of the stream was encountered before a complete value was read.
Note that this error condition may also be represented as a ReadErrorKind::Io with kind UnexpectedEof.
FloatNotFinite
MessageKind(Message)
Available on crate features
tokio-tungstenite or tungstenite only.Received a non-Binary WebSocket message (e.g. Text or Ping).
ReadNever
Attempted to read an empty type
TryReserve(TryReserveError)
UnknownVariant8(u8)
UnknownVariant16(u16)
UnknownVariant32(u32)
UnknownVariant64(u64)
UnknownVariant128(u128)
WebSocketTextMessage(Option<char>)
Available on crate features
tokio-tungstenite or tungstenite only.Io(Error)
ParseInt(ParseIntError)
Available on crate features
tokio-tungstenite or tungstenite only.Tungstenite(Error)
Available on crate features
tokio-tungstenite or tungstenite only.Utf8(FromUtf8Error)
Trait Implementations§
source§impl Debug for ReadErrorKind
impl Debug for ReadErrorKind
source§impl Display for ReadErrorKind
impl Display for ReadErrorKind
source§impl Error for ReadErrorKind
impl Error for ReadErrorKind
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<'a> From<&'a str> for ReadErrorKind
impl<'a> From<&'a str> for ReadErrorKind
source§impl From<Error> for ReadErrorKind
impl From<Error> for ReadErrorKind
source§impl From<Error> for ReadErrorKind
impl From<Error> for ReadErrorKind
source§impl From<FromUtf8Error> for ReadErrorKind
impl From<FromUtf8Error> for ReadErrorKind
source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
source§impl From<Infallible> for ReadErrorKind
impl From<Infallible> for ReadErrorKind
source§fn from(never: Infallible) -> Self
fn from(never: Infallible) -> Self
Converts to this type from the input type.
source§impl From<ParseIntError> for ReadErrorKind
impl From<ParseIntError> for ReadErrorKind
source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Converts to this type from the input type.
source§impl From<ReadErrorKind> for Error
impl From<ReadErrorKind> for Error
source§fn from(e: ReadErrorKind) -> Self
fn from(e: ReadErrorKind) -> Self
Converts to this type from the input type.
source§impl From<String> for ReadErrorKind
impl From<String> for ReadErrorKind
source§impl From<TryFromIntError> for ReadErrorKind
impl From<TryFromIntError> for ReadErrorKind
source§fn from(source: TryFromIntError) -> Self
fn from(source: TryFromIntError) -> Self
Converts to this type from the input type.
source§impl From<TryReserveError> for ReadErrorKind
impl From<TryReserveError> for ReadErrorKind
source§fn from(e: TryReserveError) -> Self
fn from(e: TryReserveError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for ReadErrorKind
impl !RefUnwindSafe for ReadErrorKind
impl Send for ReadErrorKind
impl Sync for ReadErrorKind
impl Unpin for ReadErrorKind
impl !UnwindSafe for ReadErrorKind
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> 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