Enum casper_types::Key
source ·
[−]#[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,
EraSummary,
}Expand description
The type under which data (e.g. CLValues, smart contracts, user accounts)
are indexed on the network.
Variants
Account(AccountHash)
Tuple Fields
0: AccountHashA Key under which a user account is stored.
Hash(HashAddr)
Tuple Fields
0: HashAddrA Key under which a smart contract is stored and which is the pseudo-hash of the
contract.
URef(URef)
Tuple Fields
0: URefA Key which is a URef, under which most types of data can be stored.
Transfer(TransferAddr)
Tuple Fields
0: TransferAddrA Key under which we store a transfer.
DeployInfo(DeployHash)
Tuple Fields
0: DeployHashA Key under which we store a deploy info.
EraInfo(EraId)
Tuple Fields
0: EraIdA Key under which we store an era info.
Balance(URefAddr)
Tuple Fields
0: URefAddrA Key under which we store a purse balance.
Bid(AccountHash)
Tuple Fields
0: AccountHashA Key under which we store bid information
Withdraw(AccountHash)
Tuple Fields
0: AccountHashA Key under which we store unbond information.
Dictionary(DictionaryAddr)
Tuple Fields
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.
EraSummary
A Key under which we store current era info.
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 URefAddr if self is of type Key::Balance,
otherwise returns None.
Returns a reference to the inner DictionaryAddr if self is of type
Key::Dictionary, otherwise returns None.
Creates a new Key::Dictionary variant based on a seed_uref and a dictionary_item_key
bytes.
Trait Implementations
Deserialize this value from the given Serde deserializer. 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
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
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
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
Auto Trait Implementations
impl RefUnwindSafe for Key
impl UnwindSafe for Key
Blanket Implementations
Mutably borrows from an owned value. 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
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a 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
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.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
Immutably dereferences self for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self for modification.
