Struct rubble::l2cap::ChannelData[][src]

pub struct ChannelData<'a, P: ?Sized> {
    response_channel: Channel,
    protocol: &'a mut P,
    pdu: u8,
}
Expand description

Data associated with a connected L2CAP channel.

Fields

response_channel: Channel

Channel to which responses should be addressed.

For fixed, predefined channels, this is always the same value for both devices, but dynamically allocated channels can have different CIDs on both devices.

protocol: &'a mut P

The protocol listening on this channel.

pdu: u8

Outgoing PDU size of the protocol.

This is the number of bytes that must be available to the protocol in the TX buffer to guarantee that all of the protocol’s PDUs will fit.

Implementations

Creates a ChannelData carrying a dynamically-dispatched dyn ProtocolObj from a concrete Protocol implementor T.

Returns the Channel to which the response should be sent.

Returns the PDU size required by the protocol.

This is the minimum size in Bytes the protocol needs to have provided for any of its outgoing PDUs. Protocol implementations may make use of additional space as well, but this is the very minimum.

The L2CAP implementation will not forward incoming PDUs to the protocol unless this amount of space is available in the TX buffer. This guarantees that the response will always fit.

Returns the protocol connected to the channel.

Consumes self and returns the protocol connected to the channel, with lifetime 'a.

This can be useful when the lifetime of the reference must not be tied to self, as would be the case with protocol().

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.