[−][src]Struct exonum_merkledb::Patch
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]
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.
fn snapshot(&self) -> &dyn Snapshot
[src]
fn changes(&self, _address: &ResolvedAddress) -> Self::Changes
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,