TrieKey

Enum TrieKey 

Source
pub enum TrieKey {
    Account {
        account_id: AccountId,
    },
    ContractCode {
        account_id: AccountId,
    },
    AccessKey {
        account_id: AccountId,
        public_key: PublicKey,
    },
    ReceivedData {
        receiver_id: AccountId,
        data_id: CryptoHash,
    },
    PostponedReceiptId {
        receiver_id: AccountId,
        data_id: CryptoHash,
    },
    PendingDataCount {
        receiver_id: AccountId,
        receipt_id: CryptoHash,
    },
    PostponedReceipt {
        receiver_id: AccountId,
        receipt_id: CryptoHash,
    },
    DelayedReceiptIndices,
    DelayedReceipt {
        index: u64,
    },
    ContractData {
        account_id: AccountId,
        key: Vec<u8>,
    },
    Rsa2048Keys {
        account_id: AccountId,
        public_key: PublicKey,
    },
}
Expand description

Describes the key of a specific key-value record in a state trie.

Variants§

§

Account

Used to store primitives::account::Account struct for a given AccountId.

Fields

§account_id: AccountId
§

ContractCode

Used to store Vec<u8> contract code for a given AccountId.

Fields

§account_id: AccountId
§

AccessKey

Used to store primitives::account::AccessKey struct for a given AccountId and a given public_key of the AccessKey.

Fields

§account_id: AccountId
§public_key: PublicKey
§

ReceivedData

Used to store primitives::receipt::ReceivedData struct for a given receiver’s AccountId of DataReceipt and a given data_id (the unique identifier for the data). NOTE: This is one of the input data for some action receipt. The action receipt might be still not be received or requires more pending input data.

Fields

§receiver_id: AccountId
§data_id: CryptoHash
§

PostponedReceiptId

Used to store receipt ID primitives::hash::CryptoHash for a given receiver’s AccountId of the receipt and a given data_id (the unique identifier for the required input data). NOTE: This receipt ID indicates the postponed receipt. We store receipt_id for performance purposes to avoid deserializing the entire receipt.

Fields

§receiver_id: AccountId
§data_id: CryptoHash
§

PendingDataCount

Used to store the number of still missing input data u32 for a given receiver’s AccountId and a given receipt_id of the receipt.

Fields

§receiver_id: AccountId
§receipt_id: CryptoHash
§

PostponedReceipt

Used to store the postponed receipt primitives::receipt::Receipt for a given receiver’s AccountId and a given receipt_id of the receipt.

Fields

§receiver_id: AccountId
§receipt_id: CryptoHash
§

DelayedReceiptIndices

Used to store indices of the delayed receipts queue (node-runtime::DelayedReceiptIndices). NOTE: It is a singleton per shard.

§

DelayedReceipt

Used to store a delayed receipt primitives::receipt::Receipt for a given index u64 in a delayed receipt queue. The queue is unique per shard.

Fields

§index: u64
§

ContractData

Used to store a key-value record Vec<u8> within a contract deployed on a given AccountId and a given key.

Fields

§account_id: AccountId
§key: Vec<u8>
§

Rsa2048Keys

ca rsakeys

Fields

§account_id: AccountId
§public_key: PublicKey

Implementations§

Source§

impl TrieKey

Source

pub fn len(&self) -> usize

Source

pub fn append_into(&self, buf: &mut Vec<u8>)

Source

pub fn to_vec(&self) -> Vec<u8>

Source

pub fn get_account_id(&self) -> Option<AccountId>

Extracts account id from a TrieKey if available.

Trait Implementations§

Source§

impl BorshDeserialize for TrieKey

Source§

fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>

Source§

fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
Source§

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
Source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

Source§

impl BorshSerialize for TrieKey

Source§

fn serialize<__W: Write>(&self, writer: &mut __W) -> Result<(), Error>

Source§

impl Clone for TrieKey

Source§

fn clone(&self) -> TrieKey

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TrieKey

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl EnumExt for TrieKey

Source§

fn deserialize_variant<__R: Read>( reader: &mut __R, variant_tag: u8, ) -> Result<Self, Error>

Deserialises given variant of an enum from the reader. Read more
Source§

impl PartialEq for TrieKey

Source§

fn eq(&self, other: &TrieKey) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for TrieKey

Source§

impl StructuralPartialEq for TrieKey

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more