[−][src]Struct esb::payload::EsbHeader
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]
max_payload_length: u8,
pid: u8,
pipe: u8,
no_ack: bool
) -> Result<Self, Error>
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]
fn clone(&self) -> EsbHeader
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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
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,
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.
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>,