[][src]Struct bm_le::List

pub struct List<R, C>(_)
where
    C: Construct,
    R: RootStatus
;

Binary merkle vector.

Methods

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

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

Get value at index.

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

Set value at index.

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

Push a new value to the vector.

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

Pop a value from the vector.

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

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

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

Reconstruct the vector from a single hash value.

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

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

Create a new vector.

Trait Implementations

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

type RootStatus = R

Root status of the tree.

type Construct = C

Construct of the tree.

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

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

Metadata to represent this merkle struct.

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

Auto Trait Implementations

impl<R, C> Sync for List<R, C> where
    C: Sync,
    R: Sync,
    <C as Construct>::End: Sync,
    <C as Construct>::Intermediate: Sync

impl<R, C> Send for List<R, C> where
    C: Send,
    R: Send,
    <C as Construct>::End: Send,
    <C as Construct>::Intermediate: Send

impl<R, C> Unpin for List<R, C> where
    C: Unpin,
    R: Unpin,
    <C as Construct>::End: Unpin,
    <C as Construct>::Intermediate: Unpin

impl<R, C> RefUnwindSafe for List<R, C> where
    C: RefUnwindSafe,
    R: RefUnwindSafe,
    <C as Construct>::End: RefUnwindSafe,
    <C as Construct>::Intermediate: RefUnwindSafe

impl<R, C> UnwindSafe for List<R, C> where
    C: UnwindSafe,
    R: UnwindSafe,
    <C as Construct>::End: UnwindSafe,
    <C as Construct>::Intermediate: UnwindSafe

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<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