[−][src]Struct esb::payload::EsbHeaderBuilder
A builder for an EsbHeader
structure
The builder is converted into an EsbHeader
by calling the
check()
method.
Example
use esb::EsbHeaderBuilder; let header_result = EsbHeaderBuilder::default() .max_payload(252) .pid(0) .pipe(0) .no_ack(true) .check(); assert!(header_result.is_ok());
Default Header Contents
By default, the following settings will be used:
Field | Default Value |
---|---|
pid | 0 |
no_ack | true |
length | 0 |
pipe | 0 |
Implementations
impl EsbHeaderBuilder
[src]
pub fn pipe(self, pipe: u8) -> Self
[src]
Set the pipe. Must be in the range 0..=7.
pub fn max_payload(self, max_payload: u8) -> Self
[src]
Set the max payload. Must be in the range 0..=252.
pub fn no_ack(self, no_ack: bool) -> Self
[src]
Enable/disable acknowledgment
pub fn pid(self, pid: u8) -> Self
[src]
Set the pid. Must be in the range 0..=3.
pub fn check(self) -> Result<EsbHeader, Error>
[src]
Finalize the header.
If the set parameters are out of range, an error will be returned.
Trait Implementations
impl Clone for EsbHeaderBuilder
[src]
fn clone(&self) -> EsbHeaderBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for EsbHeaderBuilder
[src]
impl Default for EsbHeaderBuilder
[src]
impl Eq for EsbHeaderBuilder
[src]
impl PartialEq<EsbHeaderBuilder> for EsbHeaderBuilder
[src]
fn eq(&self, other: &EsbHeaderBuilder) -> bool
[src]
fn ne(&self, other: &EsbHeaderBuilder) -> bool
[src]
impl StructuralEq for EsbHeaderBuilder
[src]
impl StructuralPartialEq for EsbHeaderBuilder
[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>,