Enum trie_db::TrieAccess

source ·
pub enum TrieAccess<'a, H> {
    NodeOwned {
        hash: H,
        node_owned: &'a NodeOwned<H>,
    },
    EncodedNode {
        hash: H,
        encoded_node: Cow<'a, [u8]>,
    },
    Value {
        hash: H,
        value: Cow<'a, [u8]>,
        full_key: &'a [u8],
    },
    InlineValue {
        full_key: &'a [u8],
    },
    Hash {
        full_key: &'a [u8],
    },
    NonExisting {
        full_key: &'a [u8],
    },
}
Expand description

Used to report the trie access to the TrieRecorder.

As the trie can use a TrieCache, there are multiple kinds of accesses. If a cache is used, [Self::Key] and Self::NodeOwned are possible values. Otherwise only Self::EncodedNode is a possible value.

Variants§

§

NodeOwned

The given NodeOwned was accessed using its hash.

Fields

§hash: H
§node_owned: &'a NodeOwned<H>
§

EncodedNode

The given encoded_node was accessed using its hash.

Fields

§hash: H
§encoded_node: Cow<'a, [u8]>
§

Value

The given value was accessed using its hash.

The given full_key is the key to access this value in the trie.

Should map to RecordedForKey::Value when checking the recorder.

Fields

§hash: H
§value: Cow<'a, [u8]>
§full_key: &'a [u8]
§

InlineValue

A value was accessed that is stored inline a node.

As the value is stored inline there is no need to separately record the value as it is part of a node. The given full_key is the key to access this value in the trie.

Should map to RecordedForKey::Value when checking the recorder.

Fields

§full_key: &'a [u8]
§

Hash

The hash of the value for the given full_key was accessed.

Should map to RecordedForKey::Hash when checking the recorder.

Fields

§full_key: &'a [u8]
§

NonExisting

The value/hash for full_key was accessed, but it couldn’t be found in the trie.

Should map to RecordedForKey::Value when checking the recorder.

Fields

§full_key: &'a [u8]

Trait Implementations§

source§

impl<'a, H: Debug> Debug for TrieAccess<'a, H>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, H> Freeze for TrieAccess<'a, H>
where H: Freeze,

§

impl<'a, H> RefUnwindSafe for TrieAccess<'a, H>
where H: RefUnwindSafe,

§

impl<'a, H> Send for TrieAccess<'a, H>
where H: Send + Sync,

§

impl<'a, H> Sync for TrieAccess<'a, H>
where H: Sync,

§

impl<'a, H> Unpin for TrieAccess<'a, H>
where H: Unpin,

§

impl<'a, H> UnwindSafe for TrieAccess<'a, H>

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

source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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<T> MaybeDebug for T
where T: Debug,