Struct near_store::Trie[][src]

pub struct Trie {
    pub counter: TouchedNodesCounter,
    // some fields omitted
}

Fields

counter: TouchedNodesCounter

Implementations

impl Trie[src]

pub fn get_trie_nodes_for_part(
    &self,
    part_id: u64,
    num_parts: u64,
    state_root: &StateRoot
) -> Result<PartialState, StorageError>
[src]

Computes the set of trie nodes for a state part.

Panics

storage must be a TrieCachingStorage part_id must be in [0..num_parts)

Errors

StorageError if the storage is corrupted

pub fn validate_trie_nodes_for_part(
    state_root: &StateRoot,
    part_id: u64,
    num_parts: u64,
    trie_nodes: PartialState
) -> Result<(), StorageError>
[src]

Validate state part

Panics

part_id must be in [0..num_parts)

Errors

StorageError::TrieNodeWithMissing if some nodes are missing

pub fn apply_state_part(
    state_root: &StateRoot,
    part_id: u64,
    num_parts: u64,
    part: Vec<Vec<u8>>
) -> Result<TrieChanges, StorageError>
[src]

Returns the storage changes for the state part. Writing all storage changes gives the complete trie.

pub fn get_memory_usage_from_serialized(
    bytes: &Vec<u8>
) -> Result<u64, StorageError>
[src]

impl Trie[src]

pub fn new(store: Box<dyn TrieStorage>, _shard_id: ShardId) -> Self[src]

pub fn recording_reads(&self) -> Self[src]

pub fn empty_root() -> StateRoot[src]

pub fn recorded_storage(&self) -> Option<PartialStorage>[src]

pub fn from_recorded_storage(partial_storage: PartialStorage) -> Self[src]

pub fn retrieve_root_node(
    &self,
    root: &StateRoot
) -> Result<StateRootNode, StorageError>
[src]

pub fn get_ref(
    &self,
    root: &CryptoHash,
    key: &[u8]
) -> Result<Option<(u32, CryptoHash)>, StorageError>
[src]

pub fn get(
    &self,
    root: &CryptoHash,
    key: &[u8]
) -> Result<Option<Vec<u8>>, StorageError>
[src]

pub fn update<I>(
    &self,
    root: &CryptoHash,
    changes: I
) -> Result<TrieChanges, StorageError> where
    I: Iterator<Item = (Vec<u8>, Option<Vec<u8>>)>, 
[src]

pub fn iter<'a>(
    &'a self,
    root: &CryptoHash
) -> Result<TrieIterator<'a>, StorageError>
[src]

Auto Trait Implementations

impl !RefUnwindSafe for Trie

impl !Send for Trie

impl !Sync for Trie

impl Unpin for Trie

impl !UnwindSafe for Trie

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

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