[][src]Struct seeed_erpc::FrameHeader

pub struct FrameHeader {
    pub msg_length: u16,
    pub crc16: u16,
}

Wraps a complete RPC (Header + data) on stream transports, like a UART.

Fields

msg_length: u16crc16: u16

Implementations

impl FrameHeader[src]

pub fn new_from_msg(msg: &[u8]) -> Self[src]

Builds a frame header which will wrap the provided msg.

pub fn as_bytes(&self) -> [u8; 4][src]

Encodes the frame header in its wire format.

pub fn parse<I, E: ParseError<I>>(i: I) -> IResult<I, Self, E> where
    I: Slice<RangeFrom<usize>> + InputIter<Item = u8> + InputLength
[src]

Nom parser which decodes a leading FrameHeader from the input. Can be chained with other nom parsers.

pub fn check_crc<I, E>(&self, data: I) -> Result<(), Err<E>> where
    I: InputIter<Item = u8>, 
[src]

Checks the CRC matches that computed from the provided payload.

Trait Implementations

impl Clone for FrameHeader[src]

impl Debug for FrameHeader[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> Same<T> for T

type Output = T

Should always be Self

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.