Struct pro_primitives::Key[][src]

#[repr(transparent)]pub struct Key(_);

Key into contract storage.

Used to identify contract storage cells for read and write operations. Can be compared to a raw pointer and features simple pointer arithmetic.

Note

This is the most low-level primitive to identify contract storage cells.

Unsafe

Prefer using high-level types found in pro_storage to operate on the contract storage.

Implementations

impl Key[src]

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

Tries to return the underlying bytes as slice.

This only returns Some if the execution environment has little-endian byte order.

pub fn as_bytes(&self) -> &[u8; 32][src]

Returns the underlying bytes of the key.

This only works and is supported if the target machine has little-endian byte ordering. Use Key::try_as_bytes as a general procedure instead.

impl Key[src]

pub fn to_bytes(&self) -> [u8; 32][src]

Returns the bytes that are representing the key.

Trait Implementations

impl<'a> Add<&'a u64> for Key[src]

type Output = Key

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'b u64> for &'a Key[src]

type Output = Key

The resulting type after applying the + operator.

impl Add<u64> for Key[src]

type Output = Key

The resulting type after applying the + operator.

impl<'a> Add<u64> for &'a Key[src]

type Output = Key

The resulting type after applying the + operator.

impl AddAssign<u64> for Key[src]

impl Clone for Key[src]

impl Copy for Key[src]

impl Debug for Key[src]

impl Decode for Key[src]

impl Default for Key[src]

impl Display for Key[src]

impl Encode for Key[src]

impl Eq for Key[src]

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

impl From<Key> for KeyPtr[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 TypeInfo for Key[src]

type Identity = Self

The type identifying for which type info is provided. Read more

Auto Trait Implementations

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<S> Codec for S where
    S: Encode + Decode
[src]

impl<T> DecodeAll for T where
    T: Decode
[src]

impl<T> DecodeLimit for T where
    T: Decode
[src]

impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ mut T> for T where
    T: Encode
[src]

impl<T> EncodeLike<Arc<T>> for T where
    T: Encode
[src]

impl<T> EncodeLike<Box<T, Global>> for T where
    T: Encode
[src]

impl<'a, T> EncodeLike<Cow<'a, T>> for T where
    T: Encode + ToOwned
[src]

impl<T> EncodeLike<Rc<T>> for T where
    T: Encode
[src]

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

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

impl<T> KeyedVec for T where
    T: Codec
[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, 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.