pub enum ProtocolError {
FrameTooLarge(u32),
MessageTooLarge {
msg_type: MessageType,
size: u32,
max: usize,
},
WrongDirection(MessageType),
UnknownMessageType(u8),
InvalidMessage(Cow<'static, str>),
Io(Error),
Tls(Cow<'static, str>),
InvalidUri(Cow<'static, str>),
ConnectionClosed,
ResourceExhausted {
requested: usize,
},
Timeout,
}Expand description
Protocol errors.
Variants§
FrameTooLarge(u32)
Frame exceeds maximum size.
MessageTooLarge
A known message type exceeds its direction-specific body limit.
WrongDirection(MessageType)
A peer sent a message reserved for the opposite direction.
UnknownMessageType(u8)
Unknown message type code.
InvalidMessage(Cow<'static, str>)
Invalid message body.
Io(Error)
I/O error.
Tls(Cow<'static, str>)
TLS error.
InvalidUri(Cow<'static, str>)
URI parse error.
ConnectionClosed
Connection closed.
ResourceExhausted
The process could not reserve bounded protocol storage.
Timeout
Timeout.
Implementations§
Source§impl ProtocolError
impl ProtocolError
pub fn invalid_message(args: Arguments<'_>) -> Self
pub fn invalid_uri(args: Arguments<'_>) -> Self
pub fn tls(args: Arguments<'_>) -> Self
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
1.30.0 · 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()
Auto Trait Implementations§
impl !RefUnwindSafe for ProtocolError
impl !UnwindSafe for ProtocolError
impl Freeze for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnsafeUnpin for ProtocolError
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