[][src]Struct esb::payload::EsbHeaderBuilder

pub struct 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:

FieldDefault Value
pid0
no_acktrue
length0
pipe0

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]

impl Debug for EsbHeaderBuilder[src]

impl Default for EsbHeaderBuilder[src]

impl Eq for EsbHeaderBuilder[src]

impl PartialEq<EsbHeaderBuilder> for EsbHeaderBuilder[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]

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.