[][src]Struct esb::payload::EsbHeader

pub struct EsbHeader { /* fields omitted */ }

The non-payload portion of an ESB packet

This is typically used to create a Packet Grant using methods from the EsbApp or EsbIrq interfaces.

Example

use esb::EsbHeader;

let builder_result = EsbHeader::build()
    .max_payload(252)
    .pid(0)
    .pipe(1)
    .no_ack(true)
    .check();

let new_result = EsbHeader::new(
    252,
    0,
    1,
    true,
);

assert_eq!(builder_result, new_result);

Implementations

impl EsbHeader[src]

pub fn build() -> EsbHeaderBuilder[src]

Create a new packet header using a builder pattern

See the docs for EsbBuilder for more information.

pub fn new(
    max_payload_length: u8,
    pid: u8,
    pipe: u8,
    no_ack: bool
) -> Result<Self, Error>
[src]

Create a new packet header

Notes on valid values:

  • max_payload_length must be between 0 and 252 bytes, inclusive.
  • pid must be between 0 and 3, inclusive.
  • pipe must be between 0 and 7, inclusive.

pub fn pid(self) -> u8[src]

Accessor for the Pipe ID of the packet

pub fn no_ack(self) -> bool[src]

Accessor for the no-ack field of the packet

pub fn payload_len(self) -> usize[src]

Accessor for the length (in bytes) of the payload

pub fn rssi(self) -> u8[src]

Accessor for the rssi of the payload

Trait Implementations

impl Clone for EsbHeader[src]

impl Copy for EsbHeader[src]

impl Debug for EsbHeader[src]

impl Eq for EsbHeader[src]

impl PartialEq<EsbHeader> for EsbHeader[src]

impl StructuralEq for EsbHeader[src]

impl StructuralPartialEq for EsbHeader[src]

Auto Trait Implementations

impl Send for EsbHeader

impl Sync for EsbHeader

impl Unpin for EsbHeader

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.