pub struct Invalid {
pub msg_id: Option<u16>,
pub sender_id: Option<u16>,
pub crc: Option<u16>,
pub invalid_frame: Vec<u8>,
}
Expand description
Invalid messages occur when either the frame or message payload doesn’t have enough bytes or the CRC does not match the messages payload. If the message is well formed with a message id and CRC and payload that all are consistent, but its message type is unknown, it should be parsed into a Unknown message.
There is something unique about Invalid messages that the payload is actually the entire frame. This is because it is possible to be able to create invalid messages from invalid frames, that may not even contain a message payload.
Fields§
§msg_id: Option<u16>
The message id of the message.
sender_id: Option<u16>
The message sender_id.
crc: Option<u16>
The crc that was in the frame
invalid_frame: Vec<u8>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Invalid
impl<'de> Deserialize<'de> for Invalid
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<SbpMsgParseError> for Invalid
impl From<SbpMsgParseError> for Invalid
source§fn from(_: SbpMsgParseError) -> Self
fn from(_: SbpMsgParseError) -> Self
Converts to this type from the input type.
source§impl PartialEq for Invalid
impl PartialEq for Invalid
source§impl SbpMessage for Invalid
impl SbpMessage for Invalid
source§fn message_name(&self) -> &'static str
fn message_name(&self) -> &'static str
Get the message name.
source§fn message_type(&self) -> Option<u16>
fn message_type(&self) -> Option<u16>
Get the message type.
source§fn set_sender_id(&mut self, new_id: u16)
fn set_sender_id(&mut self, new_id: u16)
Set the sender id.
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Number of bytes this message will take on the wire.
source§fn is_valid(&self) -> bool
fn is_valid(&self) -> bool
Tells you if the message is valid or if it is not a valid message and may need to be
special cased at certain points.
fn into_valid_msg(self) -> Result<Self, Self>
source§fn gps_time(&self) -> Option<Result<MessageTime, GpsTimeError>>
fn gps_time(&self) -> Option<Result<MessageTime, GpsTimeError>>
Get the GPS time associated with the message.
source§fn friendly_name(&self) -> &'static str
fn friendly_name(&self) -> &'static str
Get friendly name associated with the message.
impl Eq for Invalid
impl StructuralPartialEq for Invalid
Auto Trait Implementations§
impl Freeze for Invalid
impl RefUnwindSafe for Invalid
impl Send for Invalid
impl Sync for Invalid
impl Unpin for Invalid
impl UnwindSafe for Invalid
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