[][src]Struct bm_le::List

pub struct List<R, DB>(_)
where
    DB: Backend,
    R: RootStatus
;

Binary merkle vector.

Methods

impl<R, DB> List<R, DB> where
    DB: Backend,
    R: RootStatus,
    <DB as Backend>::End: From<usize>,
    <DB as Backend>::End: Into<usize>, 
[src]

pub fn get(
    &self,
    db: &DB,
    index: usize
) -> Result<Value<<DB as Backend>::Intermediate, <DB as Backend>::End>, Error<<DB as Backend>::Error>>
[src]

Get value at index.

pub fn set(
    &mut self,
    db: &mut DB,
    index: usize,
    value: Value<<DB as Backend>::Intermediate, <DB as Backend>::End>
) -> Result<(), Error<<DB as Backend>::Error>>
[src]

Set value at index.

pub fn push(
    &mut self,
    db: &mut DB,
    value: Value<<DB as Backend>::Intermediate, <DB as Backend>::End>
) -> Result<(), Error<<DB as Backend>::Error>>
[src]

Push a new value to the vector.

pub fn pop(
    &mut self,
    db: &mut DB
) -> Result<Option<Value<<DB as Backend>::Intermediate, <DB as Backend>::End>>, Error<<DB as Backend>::Error>>
[src]

Pop a value from the vector.

pub fn deconstruct(
    self,
    db: &DB
) -> Result<Value<<DB as Backend>::Intermediate, <DB as Backend>::End>, Error<<DB as Backend>::Error>>
[src]

Deconstruct the vector into one single hash value, and leak only the hash value.

pub fn reconstruct(
    root: Value<<DB as Backend>::Intermediate, <DB as Backend>::End>,
    db: &DB,
    max_len: Option<usize>
) -> Result<List<R, DB>, Error<<DB as Backend>::Error>>
[src]

Reconstruct the vector from a single hash value.

impl<DB> List<Owned, DB> where
    DB: Backend,
    <DB as Backend>::End: From<usize>,
    <DB as Backend>::End: Into<usize>, 
[src]

pub fn create(
    db: &mut DB,
    max_len: Option<usize>
) -> Result<List<Owned, DB>, Error<<DB as Backend>::Error>>
[src]

Create a new vector.

Trait Implementations

impl<R, DB> Sequence for List<R, DB> where
    DB: Backend,
    R: RootStatus,
    <DB as Backend>::End: From<usize>,
    <DB as Backend>::End: Into<usize>, 
[src]

impl<R, DB> Tree for List<R, DB> where
    DB: Backend,
    R: RootStatus,
    <DB as Backend>::End: From<usize>,
    <DB as Backend>::End: Into<usize>, 
[src]

type RootStatus = R

Root status of the tree.

type Backend = DB

Backend of the tree.

impl<R, DB> Leak for List<R, DB> where
    DB: Backend,
    R: RootStatus,
    <DB as Backend>::End: From<usize>,
    <DB as Backend>::End: Into<usize>, 
[src]

type Metadata = <LengthMixed<R, DB, Vector<Dangling, DB>> as Leak>::Metadata

Metadata to represent this merkle struct.

Auto Trait Implementations

impl<R, DB> Sync for List<R, DB> where
    R: Sync,
    <DB as Backend>::End: Sync,
    <DB as Backend>::Intermediate: Sync

impl<R, DB> Unpin for List<R, DB> where
    R: Unpin,
    <DB as Backend>::End: Unpin,
    <DB as Backend>::Intermediate: Unpin

impl<R, DB> Send for List<R, DB> where
    R: Send,
    <DB as Backend>::End: Send,
    <DB as Backend>::Intermediate: Send

impl<R, DB> RefUnwindSafe for List<R, DB> where
    R: RefUnwindSafe,
    <DB as Backend>::End: RefUnwindSafe,
    <DB as Backend>::Intermediate: RefUnwindSafe

impl<R, DB> UnwindSafe for List<R, DB> where
    R: UnwindSafe,
    <DB as Backend>::End: UnwindSafe,
    <DB as Backend>::Intermediate: UnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

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> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self