[][src]Struct exonum_merkledb::OwnedReadonlyFork

pub struct OwnedReadonlyFork(_);

Version of ReadonlyFork with a static lifetime. Can be produced from an Rc<Fork> using the AsReadonly trait.

Beware that producing an instance increases the reference counter of the underlying fork. If you need to obtain Fork from Rc<Fork> via Rc::try_unwrap, make sure that all OwnedReadonlyFork instances are dropped by this time.

Examples

let db = TemporaryDB::new();
let fork = Rc::new(db.fork());
fork.get_proof_list("list").extend(vec![1_u32, 2, 3]);
let ro_fork: OwnedReadonlyFork = fork.as_readonly();
let list = ro_fork.get_proof_list::<_, u32>("list");
assert_eq!(list.len(), 3);

Trait Implementations

impl AsReadonly for OwnedReadonlyFork[src]

type Readonly = Self

Readonly version of the access.

impl Clone for OwnedReadonlyFork[src]

impl Debug for OwnedReadonlyFork[src]

impl<'_> From<OwnedReadonlyFork> for GenericRawAccess<'_>[src]

impl RawAccess for OwnedReadonlyFork[src]

type Changes = ChangesRef<'static>

Type of the changes() that will be applied to the database.

Auto Trait Implementations

Blanket Implementations

impl<T> Access for T where
    T: RawAccess
[src]

type Base = T

Raw access serving as the basis for created indexes.

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,