pub enum MessageError {
MessageTooShort,
MalformedMsg {
cob_id: CanId,
},
UnexpectedId {
cob_id: CanId,
expected: CanId,
},
InvalidField,
UnrecognizedId {
cob_id: CanId,
},
InvalidNmtState {
value: u8,
},
UnexpectedLssCommand {
value: u8,
},
}Expand description
An error for problems converting CanMessages to zencan types
Variants§
MessageTooShort
Not enough bytes were present in the message
MalformedMsg
The message was malformed in some way
UnexpectedId
The message ID was not the expected value
InvalidField
A field in the message contained an unallowed value for that field
UnrecognizedId
The COB ID of the message does not correspond to an expected ZencanMessag
This isn’t particular surprising, many messages on the bus will not (e.g. PDOs)
InvalidNmtState
The NMT state integer in the message is not a valid NMT state
UnexpectedLssCommand
An invalid LSS command specifier was found in the message
Trait Implementations§
Source§impl Clone for MessageError
impl Clone for MessageError
Source§fn clone(&self) -> MessageError
fn clone(&self) -> MessageError
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 MessageError
impl Debug for MessageError
Source§impl Display for MessageError
impl Display for MessageError
Source§impl Error for MessageError
impl Error for MessageError
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl ErrorCompat for MessageError
impl ErrorCompat for MessageError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source. Read moreSource§impl PartialEq for MessageError
impl PartialEq for MessageError
impl Copy for MessageError
impl StructuralPartialEq for MessageError
Auto Trait Implementations§
impl Freeze for MessageError
impl RefUnwindSafe for MessageError
impl Send for MessageError
impl Sync for MessageError
impl Unpin for MessageError
impl UnwindSafe for MessageError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more