pub struct Mapping<K, V> { /* private fields */ }
Expand description

A mapping of key-value pairs directly into contract storage.

Implementations

Insert the given value to the contract storage.

Get the value at key from the contract storage.

Returns None if no value exists at the given key.

Clears the value at key from storage.

Trait Implementations

Formats the value using the given formatter. Read more

We implement this manually because the derived implementation adds trait bounds.

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

Default initializes the implementing type using spread layout. Read more

The footprint of the type. 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

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

Returns the static storage layout of Self. Read more

The type identifying for which type info is provided. Read more

Returns the static type identifier for Self.

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.