[−][src]Struct rubble::l2cap::L2CAPResponder
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]
&mut self,
f: impl FnOnce(&mut ByteWriter) -> Result<T, E>
) -> Result<T, E> where
E: From<Error>,
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]
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,