pub enum ProtocolError {
Incomplete,
UnexpectedEof,
InvalidPrefix(u8),
InvalidInteger,
InvalidFrameLength(i64),
InvalidCommandFrame(String),
WrongArity(String),
NestingTooDeep(usize),
TooManyElements(usize),
BulkStringTooLarge(usize),
}Expand description
Errors that can occur when parsing the RESP3 wire format.
Variants§
Incomplete
The input buffer doesn’t contain a complete frame yet. The caller should read more data and try again.
UnexpectedEof
Reached end of input unexpectedly while parsing a frame.
InvalidPrefix(u8)
The first byte of a frame didn’t match any known RESP3 type prefix.
InvalidInteger
Failed to parse an integer value from the frame content.
InvalidFrameLength(i64)
A bulk string or array declared an invalid length (e.g. negative).
InvalidCommandFrame(String)
Expected an array frame for a command, but got something else.
WrongArity(String)
Command received with the wrong number of arguments.
NestingTooDeep(usize)
The frame exceeds the maximum nesting depth.
TooManyElements(usize)
An array or map declares more elements than the allowed maximum.
BulkStringTooLarge(usize)
A bulk string exceeds the maximum allowed length.
Trait Implementations§
Source§impl Clone for ProtocolError
impl Clone for ProtocolError
Source§fn clone(&self) -> ProtocolError
fn clone(&self) -> ProtocolError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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()
Source§impl PartialEq for ProtocolError
impl PartialEq for ProtocolError
impl Eq for ProtocolError
impl StructuralPartialEq for ProtocolError
Auto Trait Implementations§
impl Freeze for ProtocolError
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnsafeUnpin for ProtocolError
impl UnwindSafe 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