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]
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>
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
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,