[−][src]Enum rubble::link::data::Pdu
Structured representation of a data channel PDU.
Variants
DataCont
Continuation of an L2CAP message (or empty PDU).
Fields of DataCont
DataStart
Start of an L2CAP message (must not be empty).
Fields of DataStart
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]
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
).
fn to_bytes(&self, buffer: &mut ByteWriter) -> Result<(), Error>
[src]
impl<'a, L: Debug> Debug for Pdu<'a, L>
[src]
impl<'a> From<&'a ControlPdu<'a>> for Pdu<'a, &'a [u8]>
[src]
fn from(c: &'a ControlPdu<'a>) -> Self
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom 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> From for T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,