pub enum ParseError<E: Error> {
InvalidPacketType,
InvalidAckId,
InvalidEventName,
InvalidData,
InvalidNamespace,
InvalidAttachments,
UnexpectedBinaryPacket,
UnexpectedStringPacket,
NeedsMoreBinaryData,
ParserError(E),
}
Expand description
Errors when parsing/serializing socket.io packets
Variants§
InvalidPacketType
Invalid packet type
InvalidAckId
Invalid ack id
InvalidEventName
Invalid event name
InvalidData
Invalid data
InvalidNamespace
Invalid namespace
InvalidAttachments
Invalid attachments
UnexpectedBinaryPacket
Received unexpected binary data
UnexpectedStringPacket
Received unexpected string data
NeedsMoreBinaryData
Needs more binary data before deserialization. It is not exactly an error, it is used for control flow,
e.g the common parser needs adjacent binary packets and therefore will returns
NeedsMoreBinaryData
n times for n adjacent binary packet expected.
In this case the user should call again the parser with the next binary payload.
ParserError(E)
The inner parser error
Implementations§
source§impl<E: Error> ParseError<E>
impl<E: Error> ParseError<E>
sourcepub fn wrap_err<E1: Error>(self, f: impl FnOnce(E) -> E1) -> ParseError<E1>
pub fn wrap_err<E1: Error>(self, f: impl FnOnce(E) -> E1) -> ParseError<E1>
Wrap the ParseError::ParserError
variant with a new error type
Trait Implementations§
source§impl<E> Display for ParseError<E>
impl<E> Display for ParseError<E>
source§impl<E> Error for ParseError<E>
impl<E> Error for ParseError<E>
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<E> Freeze for ParseError<E>where
E: Freeze,
impl<E> RefUnwindSafe for ParseError<E>where
E: RefUnwindSafe,
impl<E> Send for ParseError<E>where
E: Send,
impl<E> Sync for ParseError<E>where
E: Sync,
impl<E> Unpin for ParseError<E>where
E: Unpin,
impl<E> UnwindSafe for ParseError<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