pub struct MessageRef<'a> { /* private fields */ }Expand description
A safe, read-only wrapper around a CFE message byte slice.
This provides methods to access header fields without needing unsafe code
or raw pointers in your application.
Implementations§
Source§impl<'a> MessageRef<'a>
impl<'a> MessageRef<'a>
Sourcepub fn header_version(&self) -> Result<u16>
pub fn header_version(&self) -> Result<u16>
Gets the header version from the message header.
Sourcepub fn fcn_code(&self) -> Result<u16>
pub fn fcn_code(&self) -> Result<u16>
Gets the function code from a command message header.
Returns an error if the message does not have a secondary command header.
Sourcepub fn time(&self) -> Result<SysTime>
pub fn time(&self) -> Result<SysTime>
Gets the timestamp from a telemetry message header.
Returns an error if the message does not have a secondary telemetry header.
Sourcepub fn sequence_count(&self) -> Result<u16>
pub fn sequence_count(&self) -> Result<u16>
Gets the sequence count from the message header.
Sourcepub fn validate_checksum(&self) -> Result<bool>
pub fn validate_checksum(&self) -> Result<bool>
Validates the checksum of a command message.
Returns Ok(true) if the checksum is valid, Ok(false) if it is not.
Returns an error if the message does not have a command secondary header.
Sourcepub fn get_type(&self) -> Result<MsgType>
pub fn get_type(&self) -> Result<MsgType>
Gets the message type (Command or Telemetry) from the header.
Sourcepub fn has_secondary_header(&self) -> Result<bool>
pub fn has_secondary_header(&self) -> Result<bool>
Checks if the message header indicates the presence of a secondary header.
Sourcepub fn user_data_length(&self) -> usize
pub fn user_data_length(&self) -> usize
Gets the length of the user data portion of the message.
Sourcepub fn segmentation_flag(&self) -> Result<c_uint>
pub fn segmentation_flag(&self) -> Result<c_uint>
Gets the segmentation flag from the message header.
Sourcepub fn eds_version(&self) -> Result<u16>
pub fn eds_version(&self) -> Result<u16>
Gets the EDS version from the message header.
Sourcepub fn playback_flag(&self) -> Result<c_uint>
pub fn playback_flag(&self) -> Result<c_uint>
Gets the playback flag from the message header.
Trait Implementations§
Source§impl<'a> Clone for MessageRef<'a>
impl<'a> Clone for MessageRef<'a>
Source§fn clone(&self) -> MessageRef<'a>
fn clone(&self) -> MessageRef<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more