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

Fields

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

The given NodeOwned was accessed using its hash.

§

EncodedNode

Fields

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

The given encoded_node was accessed using its hash.

§

Value

Fields

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

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.

§

InlineValue

Fields

§full_key: &'a [u8]

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.

§

Hash

Fields

§full_key: &'a [u8]

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

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

§

NonExisting

Fields

§full_key: &'a [u8]

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.

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> 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>where H: UnwindSafe + RefUnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere T: Debug,