[][src]Struct bm::Vector

pub struct Vector<R: RootStatus, C: Construct> { /* fields omitted */ }

Binary merkle tuple.

Methods

impl<R: RootStatus, C: Construct> Vector<R, C>[src]

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

Current maximum length of the vector.

pub fn max_len(&self) -> Option<u64>[src]

Overall maximum length of the vector.

pub fn depth(&self) -> usize[src]

Depth of the vector.

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 len(&self) -> usize[src]

Get the length of the tuple.

pub fn from_raw(raw: Raw<R, C>, len: usize, max_len: Option<u64>) -> Self[src]

Create a tuple from raw merkle tree.

impl<C: Construct> Vector<Owned, C>[src]

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

Create a new tuple.

Trait Implementations

impl<R: RootStatus, C: Construct> Tree for Vector<R, C>[src]

type RootStatus = R

Root status of the tree.

type Construct = C

Construct of the tree.

impl<R: RootStatus, C: Construct> Sequence for Vector<R, C>[src]

impl<R: RootStatus, C: Construct> Leak for Vector<R, C>[src]

type Metadata = (C::Value, usize, Option<u64>)

Metadata to represent this merkle struct.

Auto Trait Implementations

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

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

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

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

impl<R, C> UnwindSafe for Vector<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