#[non_exhaustive]pub enum SerialError {
Overrun,
FrameFormat,
Parity,
Noise,
Closed,
Other,
}Expand description
Serial error kind.
This represents a common set of serial operation errors. HAL implementations are free to define more specific or additional error types. However, by providing a mapping to these common serial errors, generic code can still react to them.
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.
Overrun
The peripheral receive buffer was overrun.
FrameFormat
Received data does not conform to the peripheral configuration. Can be caused by a misconfigured device on either end of the serial line.
Parity
Parity check failed.
Noise
Serial line is too noisy to read valid data.
Closed
Device was closed.
Other
A different error occurred. The original error may contain more information.
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SerialError
impl Debug for SerialError
Source§impl Display for SerialError
impl Display 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 Hash for SerialError
impl Hash for SerialError
Source§impl Ord for SerialError
impl Ord for SerialError
Source§fn cmp(&self, other: &SerialError) -> Ordering
fn cmp(&self, other: &SerialError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SerialError
impl PartialEq for SerialError
Source§impl PartialOrd for SerialError
impl PartialOrd for SerialError
impl Copy for SerialError
impl Eq 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 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