pub struct BitStash { /* private fields */ }
Expand description

A stash for bits operating on the contract storage.

Allows to efficiently put and take bits and stores the underlying bits in an extremely compressed format.

Implementations

Creates a new storage bit stash.

Returns true if the bit at the indexed slot is set (1).

Returns None if the index is out of bounds.

Puts another set bit into the storage bit stash.

Returns the index to the slot where the set bit has been inserted.

Takes the bit from the given index and returns it.

Returns true if the indexed bit was set (1). Returns None if the index is out of bounds.

Note

This frees up the indexed slot for putting in another set bit.

Trait Implementations

Formats the value using the given formatter. Read more

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

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

This method tests for !=.

Default initializes the implementing type using spread layout. Read more

The footprint of the type. Read more

Pulls an instance of Self from the contract storage. Read more

Pushes an instance of Self to the contract storage. Read more

Clears an instance of Self from the contract storage. Read more

Indicates whether a type requires deep clean-up of its state meaning that a clean-up routine has to decode an entity into an instance in order to eventually recurse upon its tear-down. This is not required for the majority of primitive data types such as i32, however types such as storage::Box that might want to forward the clean-up procedure to their inner T require a deep clean-up. Read more

Returns the static storage layout of Self. 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

Performs the conversion.

Performs the conversion.

Should always be Self

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.