logo
#[repr(C)]
pub enum Key {
    Account(AccountHash),
    Hash(HashAddr),
    URef(URef),
    Transfer(TransferAddr),
    DeployInfo(DeployHash),
    EraInfo(EraId),
    Balance(URefAddr),
    Bid(AccountHash),
    Withdraw(AccountHash),
    Dictionary(DictionaryAddr),
    SystemContractRegistry,
}
Expand description

The type under which data (e.g. CLValues, smart contracts, user accounts) are indexed on the network.

Variants

Account(AccountHash)

A Key under which a user account is stored.

Hash(HashAddr)

A Key under which a smart contract is stored and which is the pseudo-hash of the contract.

URef(URef)

A Key which is a URef, under which most types of data can be stored.

Transfer(TransferAddr)

A Key under which we store a transfer.

DeployInfo(DeployHash)

A Key under which we store a deploy info.

EraInfo(EraId)

A Key under which we store an era info.

Balance(URefAddr)

A Key under which we store a purse balance.

Bid(AccountHash)

A Key under which we store bid information

Withdraw(AccountHash)

A Key under which we store unbond information.

Dictionary(DictionaryAddr)

A Key variant whose value is derived by hashing URefs address and arbitrary data.

SystemContractRegistry

A Key variant under which system contract hashes are stored.

Implementations

Returns the maximum size a Key can be serialized into.

If self is of type Key::URef, returns self with the AccessRights stripped from the wrapped URef, otherwise returns self unmodified.

Returns a human-readable version of self, with the inner bytes encoded to Base16.

Parses a string formatted as per Self::to_formatted_string() into a Key.

Returns the inner bytes of self if self is of type Key::Account, otherwise returns None.

Returns the inner bytes of self if self is of type Key::Hash, otherwise returns None.

Returns a reference to the inner URef if self is of type Key::URef, otherwise returns None.

Returns a reference to the inner URef if self is of type Key::URef, otherwise returns None.

Returns a reference to the inner URefAddr if self is of type Key::Balance, otherwise returns None.

Returns the inner URef if self is of type Key::URef, otherwise returns None.

Returns a reference to the inner DictionaryAddr if self is of type Key::Dictionary, otherwise returns None.

Casts a Key::URef to a Key::Hash

Creates a new Key::Dictionary variant based on a seed_uref and a dictionary_item_key bytes.

Trait Implementations

The CLType of Self.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Generate a random value of T, using rng as the source of randomness.

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Deserializes the slice into Self.

Deserializes the Vec<u8> into Self.

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

Serialize this value into the given Serde serializer. Read more

Returns the tag of a given object

Returns the tag of a given object

Serializes &self to a Vec<u8>.

Returns the length of the Vec<u8> which would be returned from a successful call to to_bytes() or into_bytes(). The data is not actually serialized, so this call is relatively cheap. Read more

Consumes self and serializes to a Vec<u8>.

The type returned in the event of a conversion error.

Performs the conversion.

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

Converts self into a target type. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. 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.

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Should always be Self

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

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

Attempts to convert self into a target type. 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.