Enum casper_types::Key[][src]

#[repr(C)]pub enum Key {
    Account(AccountHash),
    Hash(HashAddr),
    URef(URef),
    Transfer(TransferAddr),
    DeployInfo(DeployHash),
    EraInfo(EraId),
    Balance([u8; 32]),
    Bid(AccountHash),
    Withdraw(AccountHash),
}

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([u8; 32])

A Key under which we store a purse balance.

A Key under which we store bid information

Withdraw(AccountHash)

A Key under which we store unbond information.

Implementations

impl Key[src]

pub const fn max_serialized_length() -> usize[src]

Returns the maximum size a Key can be serialized into.

pub fn normalize(self) -> Key[src]

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

pub fn to_formatted_string(&self) -> String[src]

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

pub fn from_formatted_str(input: &str) -> Result<Key, FromStrError>[src]

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

pub fn into_account(self) -> Option<AccountHash>[src]

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

pub fn into_hash(self) -> Option<HashAddr>[src]

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

pub fn as_uref(&self) -> Option<&URef>[src]

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

pub fn into_uref(self) -> Option<URef>[src]

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

pub fn uref_to_hash(&self) -> Option<Key>[src]

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

Trait Implementations

impl CLTyped for Key[src]

impl Clone for Key[src]

impl Copy for Key[src]

impl DataSize for Key where
    AccountHash: DataSize,
    HashAddr: DataSize,
    URef: DataSize,
    TransferAddr: DataSize,
    DeployHash: DataSize,
    EraId: DataSize,
    [u8; 32]: DataSize,
    AccountHash: DataSize,
    AccountHash: DataSize
[src]

impl Debug for Key[src]

impl<'de> Deserialize<'de> for Key[src]

impl Display for Key[src]

impl Eq for Key[src]

impl From<[u8; 32]> for Key[src]

impl From<AccountHash> for Key[src]

impl From<ContractHash> for Key[src]

impl From<ContractPackageHash> for Key[src]

impl From<ContractWasmHash> for Key[src]

impl From<TransferAddr> for Key[src]

impl From<URef> for Key[src]

impl FromBytes for Key[src]

impl Hash for Key[src]

impl Ord for Key[src]

impl PartialEq<Key> for Key[src]

impl PartialOrd<Key> for Key[src]

impl Serialize for Key[src]

impl StructuralEq for Key[src]

impl StructuralPartialEq for Key[src]

impl Tagged<KeyTag> for Key[src]

impl Tagged<u8> for Key[src]

impl ToBytes for Key[src]

impl TryFrom<Key> for URef[src]

type Error = ApiError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Key

impl Send for Key

impl Sync for Key

impl Unpin for Key

impl UnwindSafe for Key

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,