Struct prust_core::sp::PrimaryHeader[][src]

pub struct PrimaryHeader { /* fields omitted */ }

Big endian is the byte order used in these packages

Implementations

impl PrimaryHeader[src]

pub const PH_LEN: usize[src]

pub fn new(
    ver_no: u8,
    type_flag: bool,
    sec_header_flag: bool,
    apid: u16,
    seq_flags: (bool, bool),
    packet_name: u16,
    data_len: u16
) -> Result<Self, Error>
[src]

Creates a packet header data structure with each field given

Errors

Gives an error if ver_no > 8 or apid > 2^11 or packet_name > 2^14 or data.len is not equal to the data_len field given.

pub fn from_bytes(packet: &[u8]) -> Result<Self, Error>[src]

Creates a PrimaryHeader structure from the given 6 byte array

Errors

Sends error when packet.len() != 6.

pub fn to_bytes(&self) -> [u8; 6][src]

Returns the primary header as a fixed size 6 byte u8 array

pub fn get_data_len(&self) -> usize[src]

Trait Implementations

impl Debug for PrimaryHeader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.