[][src]Struct bm::List

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

Binary merkle vector.

Methods

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

pub fn get<DB: ReadBackend<Construct = C> + ?Sized>(
    &self,
    db: &mut DB,
    index: usize
) -> Result<C::Value, Error<DB::Error>>
[src]

Get value at index.

pub fn set<DB: WriteBackend<Construct = C> + ?Sized>(
    &mut self,
    db: &mut DB,
    index: usize,
    value: C::Value
) -> Result<(), Error<DB::Error>>
[src]

Set value at index.

pub fn push<DB: WriteBackend<Construct = C> + ?Sized>(
    &mut self,
    db: &mut DB,
    value: C::Value
) -> Result<(), Error<DB::Error>>
[src]

Push a new value to the vector.

pub fn pop<DB: WriteBackend<Construct = C> + ?Sized>(
    &mut self,
    db: &mut DB
) -> Result<Option<C::Value>, Error<DB::Error>>
[src]

Pop a value from the vector.

pub fn deconstruct<DB: ReadBackend<Construct = C> + ?Sized>(
    self,
    db: &mut DB
) -> Result<C::Value, Error<DB::Error>>
[src]

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

pub fn reconstruct<DB: WriteBackend<Construct = C> + ?Sized>(
    root: C::Value,
    db: &mut DB,
    max_len: Option<u64>
) -> Result<Self, Error<DB::Error>>
[src]

Reconstruct the vector from a single hash value.

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

pub fn create<DB: WriteBackend<Construct = C> + ?Sized>(
    db: &mut DB,
    max_len: Option<u64>
) -> Result<Self, Error<DB::Error>>
[src]

Create a new vector.

Trait Implementations

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

type RootStatus = R

Root status of the tree.

type Construct = C

Construct of the tree.

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

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

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

Metadata to represent this merkle struct.

Auto Trait Implementations

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

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

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

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

impl<R, C> UnwindSafe for List<R, C> where
    C: UnwindSafe,
    R: UnwindSafe,
    <C as Construct>::Value: 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