[−][src]Struct proof::cache::Cache
Stores the mapping of nodes to their chunks.
Methods
impl Cache
[src]
pub fn new() -> Self
[src]
Instantiate an empty Cache
.
pub fn get(&self, index: NodeIndex) -> Option<&Vec<u8>>
[src]
Gets a reference to the chunk coresponding to the node index.
pub fn insert(&mut self, index: NodeIndex, chunk: Vec<u8>) -> Option<Vec<u8>>
[src]
Sets the chunk for the node index and returns the old value.
pub fn nodes(&self) -> Vec<NodeIndex>
[src]
Retrieves a vector of set node indicies.
pub fn contains_node(&self, index: NodeIndex) -> bool
[src]
Returns true
if the cache contains a chunk for the specified node index.
pub fn is_valid(&self, root: Vec<u8>) -> bool
[src]
Determines if the current merkle tree is valid.
pub fn fill(&mut self) -> Result<(), Error>
[src]
Inserts missing nodes into the merkle tree that can be generated from existing nodes.
pub fn refresh(&mut self) -> Result<(), Error>
[src]
Trait Implementations
impl PartialEq<Cache> for Cache
[src]
impl Default for Cache
[src]
impl Clone for Cache
[src]
fn clone(&self) -> Cache
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Cache
[src]
impl Index<usize> for Cache
[src]
Auto Trait Implementations
impl Send for Cache
impl Unpin for Cache
impl Sync for Cache
impl UnwindSafe for Cache
impl RefUnwindSafe for Cache
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self