Struct capsules_extra::ieee802154::framer::Frame

source ·
pub struct Frame { /* private fields */ }
Expand description

A Frame wraps a static mutable byte slice and keeps just enough information about its header contents to expose a restricted interface for modifying its payload. This enables the user to abdicate any concerns about where the payload should be placed in the buffer.

Implementations§

source§

impl Frame

source

pub fn into_buf(self) -> &'static mut [u8]

Consumes the frame and retrieves the buffer it wraps

source

pub fn remaining_data_capacity(&self) -> usize

Calculates how much more data this frame can hold

source

pub fn append_payload(&mut self, payload: &[u8]) -> Result<(), ErrorCode>

Appends payload bytes into the frame if possible

source

pub fn append_payload_process( &mut self, payload_buf: &ReadableProcessSlice, ) -> Result<(), ErrorCode>

Appends payload bytes from a process slice into the frame if possible

Trait Implementations§

source§

impl Debug for Frame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Frame

source§

fn eq(&self, other: &Frame) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Frame

source§

impl StructuralPartialEq for Frame

Auto Trait Implementations§

§

impl Freeze for Frame

§

impl RefUnwindSafe for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl !UnwindSafe for Frame

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

§

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

§

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.