Struct rubble::link::channel_map::ChannelMap[][src]

pub struct ChannelMap {
    raw: [u8; 5],
    num_used_channels: u8,
}
Expand description

A map marking data channels as used or unused.

A channel map must mark at least 2 channels as used.

Fields

raw: [u8; 5]num_used_channels: u8

Implementations

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.

Returns the raw bytes encoding this channel map.

Creates a new channel map that marks all data channels as used.

Returns the number of data channels marked as used by this map.

Returns whether the given data channel is marked as used.

Returns an iterator over all data channels marked as used in this map.

Returns the nth channel marked as used.

Panics

This will panic when n >= self.num_used_channels().

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

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.