pub enum LongFrameError {
IncompleteHeader {
actual: usize,
},
InvalidLength {
expected: usize,
actual: usize,
},
InvalidStart {
index: usize,
actual: u8,
},
MismatchedDataLengths {
first: u8,
second: u8,
},
InvalidDataLength {
actual: u8,
},
InvalidStop {
actual: u8,
},
InvalidChecksum {
expected: u8,
actual: u8,
},
Control(ControlError),
InvalidUserDataLength {
actual: usize,
},
OutputTooSmall {
required: usize,
actual: usize,
},
}Expand description
Error produced while constructing, encoding, or decoding a long frame.
Variants§
IncompleteHeader
Fewer than four header bytes were supplied.
InvalidLength
The encoded length differed from that declared by the frame.
InvalidStart
A start byte was invalid.
MismatchedDataLengths
The repeated length fields differed.
InvalidDataLength
The length field did not leave room for user data.
InvalidStop
The stop byte was invalid.
InvalidChecksum
The checksum did not match the frame contents.
Control(ControlError)
The control field is invalid for a variable-format frame.
InvalidUserDataLength
User data was empty or exceeded 252 bytes.
OutputTooSmall
The output buffer was too small.
Trait Implementations§
Source§impl Clone for LongFrameError
impl Clone for LongFrameError
Source§fn clone(&self) -> LongFrameError
fn clone(&self) -> LongFrameError
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 LongFrameError
Source§impl Debug for LongFrameError
impl Debug for LongFrameError
Source§impl Display for LongFrameError
impl Display for LongFrameError
impl Eq for LongFrameError
Source§impl Error for LongFrameError
impl Error for LongFrameError
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 LongFrameError
impl PartialEq for LongFrameError
impl StructuralPartialEq for LongFrameError
Auto Trait Implementations§
impl Freeze for LongFrameError
impl RefUnwindSafe for LongFrameError
impl Send for LongFrameError
impl Sync for LongFrameError
impl Unpin for LongFrameError
impl UnsafeUnpin for LongFrameError
impl UnwindSafe for LongFrameError
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