[−][src]Struct rubble::phy::ChannelMap
A map marking data channels as used or unused.
A channel map must mark at least 2 channels as used.
Methods
impl ChannelMap
[src]
pub fn from_raw(raw: [u8; 5]) -> Self
[src]
Create a new channel map from the raw format used in Connection Request PDUs (ChM
).
The first byte (LSB) contains flags for data channels 0 to 7, where the least significant bit is the flag for channel 0, and so on.
Since there are only 37 data channels, but 40 bits in the 5 Bytes, the 3 most significant
bits in the last Byte of raw
are considered reserved for future use (RFU) and are ignored
by this function.
pub fn to_raw(&self) -> [u8; 5]
[src]
Returns the raw bytes encoding this channel map.
pub fn with_all_channels() -> Self
[src]
Creates a new channel map that marks all data channels as used.
pub fn num_used_channels(&self) -> u8
[src]
Returns the number of data channels marked as used by this map.
pub fn is_used(&self, channel: DataChannel) -> bool
[src]
Returns whether the given data channel is marked as used.
pub fn iter_used<'a>(&'a self) -> impl Iterator<Item = DataChannel> + 'a
[src]
Returns an iterator over all data channels marked as used in this map.
pub fn by_index(&self, n: u8) -> DataChannel
[src]
Trait Implementations
impl PartialEq<ChannelMap> for ChannelMap
[src]
fn eq(&self, other: &ChannelMap) -> bool
[src]
fn ne(&self, other: &ChannelMap) -> bool
[src]
impl Eq for ChannelMap
[src]
impl Clone for ChannelMap
[src]
fn clone(&self) -> ChannelMap
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for ChannelMap
[src]
impl Debug for ChannelMap
[src]
impl Display for ChannelMap
[src]
Auto Trait Implementations
impl Send for ChannelMap
impl Sync for ChannelMap
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,