pub enum ControlFrameError {
InvalidLength {
actual: usize,
},
InvalidStart {
index: usize,
actual: u8,
},
InvalidDataLength {
index: usize,
actual: u8,
},
InvalidStop {
actual: u8,
},
InvalidChecksum {
expected: u8,
actual: u8,
},
Control(ControlError),
OutputTooSmall {
actual: usize,
},
}Expand description
Error produced while constructing, encoding, or decoding a control frame.
Variants§
InvalidLength
The input length was not nine bytes.
InvalidStart
A start byte was invalid.
InvalidDataLength
A length byte did not contain three.
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.
OutputTooSmall
The output buffer is shorter than nine bytes.
Trait Implementations§
Source§impl Clone for ControlFrameError
impl Clone for ControlFrameError
Source§fn clone(&self) -> ControlFrameError
fn clone(&self) -> ControlFrameError
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 ControlFrameError
Source§impl Debug for ControlFrameError
impl Debug for ControlFrameError
Source§impl Display for ControlFrameError
impl Display for ControlFrameError
impl Eq for ControlFrameError
Source§impl Error for ControlFrameError
impl Error for ControlFrameError
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 ControlFrameError
impl PartialEq for ControlFrameError
impl StructuralPartialEq for ControlFrameError
Auto Trait Implementations§
impl Freeze for ControlFrameError
impl RefUnwindSafe for ControlFrameError
impl Send for ControlFrameError
impl Sync for ControlFrameError
impl Unpin for ControlFrameError
impl UnsafeUnpin for ControlFrameError
impl UnwindSafe for ControlFrameError
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