pub enum ProtocolError {
Show 13 variants
Serialization(Error),
Deserialization(Error),
MissingType,
UnknownType(String),
InvalidPayload {
type_: String,
source: Error,
},
InvalidSession {
source: Error,
},
InvalidChannel,
MissingSession,
ConnectionClosed,
AuthFailed {
reason: String,
},
SessionNotFound {
session_id: String,
},
SessionFull,
Internal(String),
}Expand description
Errors that can occur during message serialization or deserialization.
Variants§
Serialization(Error)
Failed to serialize a message to JSON.
Deserialization(Error)
Received text is not a message: not JSON, not a JSON object, or a
type that is not a string.
MissingType
Message type field is missing or empty.
UnknownType(String)
Unknown message type received.
InvalidPayload
Payload is present but cannot be deserialized for the given type.
InvalidSession
The session field is present but is not a session ID (a UUID string).
InvalidChannel
The channel field is present but is not a channel ID: 1 to 64 ASCII
letters or digits.
MissingSession
Session ID is missing from a message that requires one.
ConnectionClosed
Connection was closed unexpectedly.
AuthFailed
Authentication failed.
SessionNotFound
Session not found.
SessionFull
Session is full (maximum frontend connections reached).
Internal(String)
Internal relay error.
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
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 Forget for ProtocolError
impl Freeze for ProtocolError
impl Move 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