[][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]

pub fn serialized_size(&self) -> usize[src]

Calculates serialized size without actually serializing data.

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

Returns max size a Key can be serialized into.

impl Key[src]

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

pub fn to_contract_ref(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(hex_encodede_hash: &str) -> Option<Key>[src]

Creates an instance of Key::Hash from the hex-encoded string. Returns None if hex_encodede_hash does not decode to a 32-byte array.

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

Creates an instance of Key::URef from the hex-encoded string. Returns None if hex_encoded_uref does not decode to a 32-byte array.

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

Creates an instance of Key::Local from the hex-encoded strings. Returns None if hex_encoded_seed does not decode to a 32-byte array, or if hex_encoded_key_bytes does does not decode from hex.

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

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

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

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

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

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<ContractRef> for Key[src]

impl<T: CLTyped> From<TURef<T>> 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]

Auto Trait Implementations

impl Send for Key

impl Sync for Key

impl Unpin 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.