[][src]Enum rubble::link::data::Pdu

pub enum Pdu<'a, L> {
    DataCont {
        message: L,
    },
    DataStart {
        message: L,
    },
    Control {
        data: BytesOr<'a, ControlPdu<'a>>,
    },
}

Structured representation of a data channel PDU.

Variants

DataCont

Continuation of an L2CAP message (or empty PDU).

Fields of DataCont

message: L
DataStart

Start of an L2CAP message (must not be empty).

Fields of DataStart

message: L
Control

LL Control PDU for controlling the Link-Layer connection.

Fields of Control

data: BytesOr<'a, ControlPdu<'a>>

Methods

impl<'a> Pdu<'a, &'a [u8]>[src]

pub fn empty() -> Self[src]

Creates an empty PDU that carries no message.

This PDU can be sent whenever there's no actual data to be transferred.

impl<'a, L> Pdu<'a, L>[src]

pub fn llid(&self) -> Llid[src]

Returns the LLID field to use for this PDU.

impl<'a, L: FromBytes<'a> + ?Sized> Pdu<'a, L>[src]

pub fn parse(header: Header, payload: &'a [u8]) -> Result<Self, Error>[src]

Parses a PDU from a Header and raw payload.

Trait Implementations

impl<'a, L: ToBytes> ToBytes for Pdu<'a, L>[src]

Serializes the payload of the PDU to bytes.

The PDU header must be constructed using Link-Layer state (and Pdu::llid).

impl<'a, L: Debug> Debug for Pdu<'a, L>[src]

impl<'a> From<&'a ControlPdu<'a>> for Pdu<'a, &'a [u8]>[src]

Auto Trait Implementations

impl<'a, L> Send for Pdu<'a, L> where
    L: Send

impl<'a, L> Sync for Pdu<'a, L> where
    L: Sync

Blanket Implementations

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> From for T[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]