[][src]Struct rubble::l2cap::L2CAPResponder

pub struct L2CAPResponder<'a> { /* fields omitted */ }

Methods

impl<'a> L2CAPResponder<'a>[src]

pub fn respond<P: ToBytes>(&mut self, payload: P) -> Result<(), Error>[src]

Enqueues an L2CAP message to be sent over the data connection.

L2CAP header (including the destination endpoint's channel) and the data channel PDU header will be added automatically.

This will fail if there's not enough space left in the TX queue.

pub fn respond_with<T, E>(
    &mut self,
    f: impl FnOnce(&mut ByteWriter) -> Result<T, E>
) -> Result<T, E> where
    E: From<Error>, 
[src]

Respond with an L2CAP message encoded by a closure.

L2CAP header and data channel PDU header will be added automatically. The closure f only has to write the protocol PDU to transmit over L2CAP.

The L2CAP implementation will ensure that there are at least Protocol::RSP_PDU_SIZE Bytes available in the ByteWriter passed to the closure.

Auto Trait Implementations

impl<'a> Send for L2CAPResponder<'a>

impl<'a> !Sync for L2CAPResponder<'a>

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]