pub struct DLCI(/* private fields */);
Expand description
Identifier for a direct link connection (DLC) between devices.
Use the TryFrom<u8>
implementation to construct a valid DLCI.
The DLCI is 6 bits wide and consists of a direction bit and a 5-bit Server Channel number. DLCIs 1 and 62-63 are reserved and never used in RFCOMM. See RFCOMM 5.4.
Implementations§
Source§impl DLCI
impl DLCI
Sourcepub const MUX_CONTROL_DLCI: DLCI
pub const MUX_CONTROL_DLCI: DLCI
The control channel for the RFCOMM Multiplexer.
pub fn is_mux_control(&self) -> bool
pub fn is_user(&self) -> bool
Sourcepub fn validate(&self, role: Role) -> Result<(), RfcommError>
pub fn validate(&self, role: Role) -> Result<(), RfcommError>
Returns Ok(()) if the DLCI belongs to the side of the session with the
given role
- this is only applicable to User DLCIs.
The DLCI space is divided into two equal parts. RFCOMM 5.2 states: “…this partitions the DLCI value space such that server applications on the non- initiating device are reachable on DLCIs 2,4,6,…,60, and server applications on the initiating device are reachable on DLCIs 3,5,7,…,61.”
Trait Implementations§
Source§impl TryFrom<DLCI> for ServerChannel
impl TryFrom<DLCI> for ServerChannel
impl Copy for DLCI
impl Eq for DLCI
impl StructuralPartialEq for DLCI
Auto Trait Implementations§
impl Freeze for DLCI
impl RefUnwindSafe for DLCI
impl Send for DLCI
impl Sync for DLCI
impl Unpin for DLCI
impl UnwindSafe for DLCI
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more