pub struct Block128<T> { /* private fields */ }
Expand description

A fixed block of optionals masked by a u128, which may thus contain at most 128 elements.

Implementations

Maximum capacity of the fixed-size block.

Checks whether the item at the index is vacant (i.e. contains None).

Returns the number of non-null elements in the block.

Returns true if the block contains zero elements.

Attempts to retrieve a shared reference to the element at index. Returns None if the slot is vacant (i.e. uninitialized).

Panic

Panics if index >= CAPACITY. See the maximum capacity.

Attempts to retrieve an exclusive reference to the element at index. Returns None if the slot is vacant (i.e. uninitialized).

Panic

Panics if index >= CAPACITY. See the maximum capacity.

Inserts the val at the index. If a value already exists, it returns Some containing the old value. Otherwise, it returns None.

Panic

Panics if index >= CAPACITY. See the maximum capacity.

Removes the value at the index. If a value already exists, it returns Some containing that value. Otherwise, it returns None.

Panic

Panics if index >= CAPACITY. See the maximum capacity.

Trait Implementations

Since the current implementation relies on MaybeUninit, the block can only be cloned if the internal data is trivially copyable (bitwise).

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Create a fully initialized direct-access table.

Converts to this type from the input type.

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.