[][src]Trait exonum_testkit::compare::ComparableSnapshot

pub trait ComparableSnapshot<S> {
    fn compare(self, old: S) -> Comparison<Box<dyn Snapshot>>;
}

Trait facilitating comparison between 2 Snapshots taken at different times.

Examples

Typical usage involves mapping the resulting comparison through the schema:

This example is not tested
let mut testkit = ...;
let old_snapshot = testkit.snapshot();
// Mutate the testkit state somehow...

testkit.snapshot()
    .compare(old_snapshot)
    .map(ServiceSchema::new)
    .assert("Something about the schema", |old, schema| {
        // Assertions...
    });

Here ServiceSchema is a public struct defined in a service library that has public new method with a signature like fn<S: AsRef<Snapshot>>(view: S) -> Self.

Required methods

fn compare(self, old: S) -> Comparison<Box<dyn Snapshot>>

Compares this snapshot with an older one.

Loading content...

Implementations on Foreign Types

impl ComparableSnapshot<Box<dyn Snapshot + 'static>> for Box<dyn Snapshot>[src]

Loading content...

Implementors

Loading content...