[−][src]Struct seeed_erpc::FrameHeader
Wraps a complete RPC (Header + data) on stream transports, like a UART.
Fields
msg_length: u16
crc16: 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]
I: Slice<RangeFrom<usize>> + InputIter<Item = u8> + InputLength,
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]
I: InputIter<Item = u8>,
Checks the CRC matches that computed from the provided payload.
Trait Implementations
impl Clone for FrameHeader
[src]
pub fn clone(&self) -> FrameHeader
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for FrameHeader
[src]
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> Same<T> for T
type Output = T
Should always be Self
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>,