Trait sbp::messages::SbpMessage
source · pub trait SbpMessage: WireFormat + Clone {
// Required methods
fn message_name(&self) -> &'static str;
fn message_type(&self) -> Option<u16>;
fn sender_id(&self) -> Option<u16>;
fn set_sender_id(&mut self, new_id: u16);
fn encoded_len(&self) -> usize;
fn is_valid(&self) -> bool;
fn into_valid_msg(self) -> Result<Self, Invalid>;
// Provided methods
fn gps_time(&self) -> Option<Result<MessageTime, GpsTimeError>> { ... }
fn friendly_name(&self) -> &'static str { ... }
}
Expand description
Common functionality available to all SBP messages.
Required Methods§
sourcefn message_name(&self) -> &'static str
fn message_name(&self) -> &'static str
Get the message name.
sourcefn message_type(&self) -> Option<u16>
fn message_type(&self) -> Option<u16>
Get the message type.
sourcefn set_sender_id(&mut self, new_id: u16)
fn set_sender_id(&mut self, new_id: u16)
Set the sender id.
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Number of bytes this message will take on the wire.
sourcefn 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, Invalid>
Provided Methods§
sourcefn gps_time(&self) -> Option<Result<MessageTime, GpsTimeError>>
fn gps_time(&self) -> Option<Result<MessageTime, GpsTimeError>>
Get the GPS time associated with the message.
sourcefn friendly_name(&self) -> &'static str
fn friendly_name(&self) -> &'static str
Get friendly name associated with the message.
Object Safety§
This trait is not object safe.