Struct MessageFrame

Source
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>

Source

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.

Source

pub fn data(&'a self) -> &'a [u8]

Returns the data segment bytes of the RTCM frame as a slice

Source

pub fn frame_data(&'a self) -> &'a [u8]

Returns the bytes of the whole RTCM frame as a slice

Source

pub fn data_len(&self) -> usize

Returns the data segment byte length

Source

pub fn frame_len(&self) -> usize

Returns the RTCM message frame byte length

Source

pub fn crc(&self) -> u32

Returns the RTCM message frame CRC24 checksum

Source

pub fn message_number(&self) -> Option<u16>

Returns the RTCM message number if the frame contains data. Otherwise returns None.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V