#[repr(transparent)]
pub struct Key(_);
Expand description

A key into the smart contract storage.

Note

  • The storage of an ink! smart contract can be viewed as a key-value store.
  • In order to manipulate its storage an ink! smart contract is required to indicate the respective cells using this primitive type.
  • The Key type can be compared to a raw pointer and also allows operations similar to pointer arithmetic.
  • Users usually should not have to deal with this low-level primitive themselves and instead use the more high-level primitives provided by the ink_storage crate.

Implementations

Creates a new key instance from the given bytes.

Note

This constructor only exists since it is not yet possible to define the From trait implementation as const.

Adds the u64 value to the key storing the result in result.

Note

This will overwrite the contents of the result key.

Trait Implementations

Performs the += operation. Read more

Performs the += operation. Read more

Performs the conversion.

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Attempt to deserialise the value from input.

Returns the fixed encoded size of the type. Read more

Attempt to skip the encoded value from input. Read more

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

Formats the value using the given formatter. Read more

If possible give a hint of expected size of the encoding. Read more

Convert self to a slice and append it to the destination.

Convert self to a slice and then invoke the given closure with it.

Calculates the encoded size. Read more

Convert self to an owned vector.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. 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

Decode Self and consume all of the given input data. Read more

Decode Self and consume all of the given input data. Read more

Decode Self and advance input by the number of bytes consumed. Read more

Decode Self with the given maximum recursion depth. Read more

Performs the conversion.

Performs the conversion.

Return an encoding of Self prepended by given slice.

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)

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.