[][src]Struct exonum_merkledb::Patch

pub struct Patch { /* fields omitted */ }

A set of changes that can be atomically applied to a Database.

This set can contain changes from multiple indexes. Changes can be read from the Patch using its RawAccess implementation.

Examples

let db = TemporaryDB::new();
let fork = db.fork();
fork.get_proof_list("list").extend(vec![1_i32, 2, 3]);
let patch: Patch = fork.into_patch();
// The patch contains changes recorded in the fork.
let list = patch.get_proof_list::<_, i32>("list");
assert_eq!(list.len(), 3);
// Unlike `Fork`, `Patch`es have consistent aggregated state.
let aggregator = SystemSchema::new(&patch).state_aggregator();
assert_eq!(aggregator.get("list").unwrap(), list.object_hash());

Trait Implementations

impl<'_> AsReadonly for &'_ Patch[src]

type Readonly = Self

Readonly version of the access.

impl Debug for Patch[src]

impl From<Patch> for Fork[src]

fn from(patch: Patch) -> Self[src]

Creates a fork based on the provided patch and snapshot.

Note: using created fork to modify data already present in patch may lead to an inconsistent database state. Hence, this method is useful only if you are sure that the fork and patch interacted with different indexes.

impl<'_> RawAccess for &'_ Patch[src]

type Changes = ()

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

impl Snapshot for Patch[src]

Auto Trait Implementations

impl !RefUnwindSafe for Patch

impl Send for Patch

impl Sync for Patch

impl Unpin for Patch

impl !UnwindSafe for Patch

Blanket Implementations

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, 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>,