pub enum WireError {
Truncated,
BadEnvelope,
BadOffset,
NegativeOffset(i64),
BadPayload(ProtocolError),
}Expand description
Wire-layer error. Only WireError::Truncated is recoverable by
the caller (read more bytes and retry); the other variants signal
a corrupt or protocol-violating peer and call for dropping the
connection.
Variants§
Truncated
Buffer ended before a complete frame; accumulate more bytes
and call decode_frame again.
BadEnvelope
Outer envelope did not start with *2\r\n (the only legal
envelope length in v1.18.0).
BadOffset
Offset element did not parse as a RESP integer (:N\r\n).
NegativeOffset(i64)
RESP integer parsed but is negative. Offsets are u64.
BadPayload(ProtocolError)
Inner multi-bulk argv was malformed at the RESP layer.
Trait Implementations§
Source§impl Error for WireError
impl Error for WireError
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 From<WireError> for ReplicaError
impl From<WireError> for ReplicaError
Auto Trait Implementations§
impl Freeze for WireError
impl RefUnwindSafe for WireError
impl Send for WireError
impl Sync for WireError
impl Unpin for WireError
impl UnsafeUnpin for WireError
impl UnwindSafe for WireError
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