[][src]Struct grin_core::core::pmmr::VecBackend

pub struct VecBackend<T: PMMRable> {
    pub data: Option<Vec<T>>,
    pub hashes: Vec<Hash>,
    pub removed: HashSet<u64>,
}

Simple/minimal/naive MMR backend implementation backed by Vec and Vec. Removed pos are maintained in a HashSet.

Fields

data: Option<Vec<T>>

Backend elements (optional, possible to just store hashes).

hashes: Vec<Hash>

Vec of hashes for the PMMR (both leaves and parents).

removed: HashSet<u64>

Positions of removed elements (is this applicable if we do not store data?)

Implementations

impl<T: PMMRable> VecBackend<T>[src]

pub fn new() -> VecBackend<T>[src]

Instantiates a new empty vec backend.

pub fn new_hash_only() -> VecBackend<T>[src]

Instantiate a new empty "hash only" vec backend.

pub fn size(&self) -> u64[src]

Size of this vec backend in hashes.

Trait Implementations

impl<T: PMMRable> Backend<T> for VecBackend<T>[src]

fn n_unpruned_leaves(&self) -> u64[src]

Number of leaves in the MMR

impl<T: Clone + PMMRable> Clone for VecBackend<T>[src]

impl<T: Debug + PMMRable> Debug for VecBackend<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for VecBackend<T> where
    T: RefUnwindSafe

impl<T> Send for VecBackend<T> where
    T: Send

impl<T> Sync for VecBackend<T> where
    T: Sync

impl<T> Unpin for VecBackend<T> where
    T: Unpin

impl<T> UnwindSafe for VecBackend<T> where
    T: UnwindSafe

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> CloneAny for T where
    T: Clone + Any

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> Erased for T

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<T> UnsafeAny for T where
    T: Any