#[non_exhaustive]pub enum ProtocolError {
Malformed(&'static str),
}Expand description
Why a buffer could not be parsed into a command (or reply). A frame
that is merely incomplete is not an error: the parsers answer
Ok(None) for it.
let e = kevy_resp::parse_command(b"*x\r\n").unwrap_err();
assert_eq!(e.to_string(), "malformed frame: bad multibulk count");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Malformed(&'static str)
A malformed frame that can never become valid (e.g. bad length prefix).
use kevy_resp::{ProtocolError, parse_command};
let err = parse_command(b"*1\r\n$x\r\n").unwrap_err();
assert!(matches!(err, ProtocolError::Malformed(_)));Trait Implementations§
Source§impl Clone for ProtocolError
impl Clone for ProtocolError
impl Copy for ProtocolError
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
impl Eq 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 Hash for ProtocolError
impl Hash for ProtocolError
Source§impl PartialEq for ProtocolError
impl PartialEq 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