pub struct MessageFrame<'a> { /* private fields */ }
Expand description
Represents the message frame of a RTCM 3.x message.
Holds a reference to the frame data as a slice for valid RTCM message frames, and provides various methods for access to data segment, message number, and CRC24
Implementations§
Source§impl<'a> MessageFrame<'a>
impl<'a> MessageFrame<'a>
Sourcepub fn new(frame_data: &'a [u8]) -> Result<Self, RtcmError>
pub fn new(frame_data: &'a [u8]) -> Result<Self, RtcmError>
Creates a new MessageFrame
from the given frame data.
Parameters:
frame_data
- A slice of bytes representing the frame data.
Errors:
RtcmError::Incomplete
- The given frame data is incomplete.RtcmError::NotValid
- The given frame data is not valid.
Returns:
A MessageFrame
if the given data represents a valid RTCM message frame.
Sourcepub fn data(&'a self) -> &'a [u8] ⓘ
pub fn data(&'a self) -> &'a [u8] ⓘ
Returns the data segment bytes of the RTCM frame as a slice
Sourcepub fn frame_data(&'a self) -> &'a [u8] ⓘ
pub fn frame_data(&'a self) -> &'a [u8] ⓘ
Returns the bytes of the whole RTCM frame as a slice
Sourcepub fn message_number(&self) -> Option<u16>
pub fn message_number(&self) -> Option<u16>
Returns the RTCM message number if the frame contains data. Otherwise returns None.
Sourcepub fn get_message(&self) -> Message
pub fn get_message(&self) -> Message
Decodes the content of the RTCM message frame and returns the result as a Message
enum.
Auto Trait Implementations§
impl<'a> Freeze for MessageFrame<'a>
impl<'a> RefUnwindSafe for MessageFrame<'a>
impl<'a> Send for MessageFrame<'a>
impl<'a> Sync for MessageFrame<'a>
impl<'a> Unpin for MessageFrame<'a>
impl<'a> UnwindSafe for MessageFrame<'a>
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