[][src]Struct bm::PackedVector

pub struct PackedVector<R: RootStatus, C: Construct, T, H: ArrayLength<u8>, V: ArrayLength<u8>> { /* fields omitted */ }

Packed merkle tuple.

Methods

impl<R: RootStatus, C: Construct, T, H: ArrayLength<u8>, V: ArrayLength<u8>> PackedVector<R, C, T, H, V> where
    C::Value: From<GenericArray<u8, H>> + AsRef<[u8]> + AsMut<[u8]>,
    T: From<GenericArray<u8, V>> + Into<GenericArray<u8, V>>, 
[src]

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

Get value at index.

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

Set value at index.

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

Push a new value to the tuple.

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

Pop a value from the tuple.

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

Create a packed tuple from raw merkle tree.

impl<C: Construct, T, H: ArrayLength<u8>, V: ArrayLength<u8>> PackedVector<Owned, C, T, H, V> where
    C::Value: From<GenericArray<u8, H>>,
    T: From<GenericArray<u8, V>>, 
[src]

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

Create a new tuple.

Trait Implementations

impl<R: RootStatus, C: Construct, T, H: ArrayLength<u8>, V: ArrayLength<u8>> Tree for PackedVector<R, C, T, H, V> where
    C::Value: From<GenericArray<u8, H>>,
    T: From<GenericArray<u8, V>>, 
[src]

type RootStatus = R

Root status of the tree.

type Construct = C

Construct of the tree.

impl<R: RootStatus, C: Construct, T, H: ArrayLength<u8>, V: ArrayLength<u8>> Sequence for PackedVector<R, C, T, H, V> where
    C::Value: From<GenericArray<u8, H>>,
    T: From<GenericArray<u8, V>>, 
[src]

impl<R: RootStatus, C: Construct, T, H: ArrayLength<u8>, V: ArrayLength<u8>> Leak for PackedVector<R, C, T, H, V> where
    C::Value: From<GenericArray<u8, H>>,
    T: From<GenericArray<u8, V>>, 
[src]

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

Metadata to represent this merkle struct.

Auto Trait Implementations

impl<R, C, T, H, V> Sync for PackedVector<R, C, T, H, V> where
    C: Sync,
    H: Sync,
    R: Sync,
    T: Sync,
    V: Sync,
    <C as Construct>::Value: Sync

impl<R, C, T, H, V> Send for PackedVector<R, C, T, H, V> where
    C: Send,
    H: Send,
    R: Send,
    T: Send,
    V: Send,
    <C as Construct>::Value: Send

impl<R, C, T, H, V> Unpin for PackedVector<R, C, T, H, V> where
    C: Unpin,
    H: Unpin,
    R: Unpin,
    T: Unpin,
    V: Unpin,
    <C as Construct>::Value: Unpin

impl<R, C, T, H, V> RefUnwindSafe for PackedVector<R, C, T, H, V> where
    C: RefUnwindSafe,
    H: RefUnwindSafe,
    R: RefUnwindSafe,
    T: RefUnwindSafe,
    V: RefUnwindSafe,
    <C as Construct>::Value: RefUnwindSafe

impl<R, C, T, H, V> UnwindSafe for PackedVector<R, C, T, H, V> where
    C: UnwindSafe,
    H: UnwindSafe,
    R: UnwindSafe,
    T: UnwindSafe,
    V: 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