pub enum SerialError {
BufferTooSmall,
InvalidEscape,
TruncatedFrame,
}Expand description
What can go wrong framing or unframing a serial packet.
Variants§
BufferTooSmall
The caller’s output buffer is too small to hold the encoded frame or the decoded
payload. The max_encoded_len helpers size a buffer that always fits.
InvalidEscape
A SLIP escape byte was followed by a byte that is neither the escaped-delimiter nor the escaped-escape marker, so the frame is corrupt.
TruncatedFrame
A frame ended early: a SLIP frame stopped in the middle of an escape sequence, or a COBS code byte claimed more data than the frame actually carried.
Trait Implementations§
Source§impl Clone for SerialError
impl Clone for SerialError
Source§fn clone(&self) -> SerialError
fn clone(&self) -> SerialError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SerialError
Source§impl Debug for SerialError
impl Debug for SerialError
Source§impl Display for SerialError
impl Display for SerialError
impl Eq for SerialError
Source§impl Error for SerialError
impl Error for SerialError
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 SerialError
impl PartialEq for SerialError
impl StructuralPartialEq for SerialError
Auto Trait Implementations§
impl Freeze for SerialError
impl RefUnwindSafe for SerialError
impl Send for SerialError
impl Sync for SerialError
impl Unpin for SerialError
impl UnsafeUnpin for SerialError
impl UnwindSafe for SerialError
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