Struct canadensis_data_types::bits::BitArray[][src]

pub struct BitArray<const BYTES: usize> { /* fields omitted */ }
Expand description

An array of bits in a format compatible with UAVCAN serialization

Because the const generics feature is incomplete, the integer generic parameter is a number of bytes (= 8 bits), not a number of bits. The functions still use bit indexes.

Implementations

Creates a bit set with all bits set to zero

Returns the number of bits in this array

Returns true if this array is empty

Returns the value of a bit at the provided bit index

Sets the value of a bit at the provided bit index

Sets all bits in this array to the specified value

Serializes this bit set (not including the length)

Note: This type doesn’t implement DataType, Serialize, or Deserialize because it is not a composite type and has an alignment of only 1 bit.

Deserializes this bit set (not including the length). self.bit_length must be set before this function is called.

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

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.

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

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.