[][src]Enum casperlabs_contract_ffi::key::Key

#[repr(C)]
pub enum Key {
    Account([u8; 32]),
    Hash([u8; 32]),
    URef(URef),
    Local([u8; 32]),
}

Variants

Account([u8; 32])
Hash([u8; 32])
URef(URef)
Local([u8; 32])

Methods

impl Key[src]

pub fn local(seed: [u8; 32], key_bytes: &[u8]) -> Self[src]

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

impl Key[src]

pub fn to_turef<T>(self) -> Option<TURef<T>>[src]

pub fn to_c_ptr(self) -> Option<ContractRef>[src]

pub fn as_account(&self) -> Option<[u8; 32]>[src]

Returns bytes of an account

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

pub fn parse_hash(addr: &str) -> Option<Key>[src]

Creates an instance of Key::Hash variant from the base16 encoded String. Returns None if [addr] is not valid Blake2b hash.

pub fn parse_uref(addr: &str, access_rights: AccessRights) -> Option<Key>[src]

Creates an instance of Key::URef variant from the base16 encoded String. Returns None if [addr] is not valid Blake2b hash.

pub fn parse_local(seed: &str, key_hash: &str) -> Option<Key>[src]

Creates an instance of Key::Local variant from the base16 encoded String. Returns None if either [seed] or [key_hash] is not valid Blake2b hash.

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

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

Trait Implementations

impl ToBytes for Key[src]

impl FromBytes for Key[src]

impl From<ContractRef> for Key[src]

impl From<URef> for Key[src]

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

impl From<Key> for Value[src]

impl Display for Key[src]

impl Debug for Key[src]

impl PartialEq<Key> for Key[src]

impl Eq for Key[src]

impl Ord for Key[src]

impl PartialOrd<Key> for Key[src]

impl TryFrom<Value> for Key[src]

type Error = String

The type returned in the event of a conversion error.

impl Hash for Key[src]

impl Copy for Key[src]

impl StructuralPartialEq for Key[src]

impl StructuralEq for Key[src]

impl Clone for Key[src]

Auto Trait Implementations

impl Unpin for Key

impl Send for Key

impl Sync for Key

Blanket Implementations

impl<T> From<T> for T[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> Into<U> for T where
    U: From<T>, 
[src]

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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> Same<T> for T

type Output = T

Should always be Self