[][src]Enum casperlabs_types::Key

#[repr(C)]pub enum Key {
    Account(AccountHash),
    Hash(HashAddr),
    URef(URef),
}

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.

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 as_string(&self) -> String[src]

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

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

Creates the seed of a local key for a context with the given base key.

Trait Implementations

impl CLTyped for Key[src]

impl Clone for Key[src]

impl Copy for Key[src]

impl Debug 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<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 StructuralEq for Key[src]

impl StructuralPartialEq 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> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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, 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.