pub trait RawAccess: Clone {
type Changes: ChangeSet;
// Required methods
fn snapshot(&self) -> &dyn Snapshot;
fn changes(&self, address: &ResolvedAddress) -> Self::Changes;
}
Expand description
Allows to read data from the database. The data consists of a snapshot and changes relative to this snapshot. Depending on the implementation, the changes can be empty, immutable or mutable.
This trait is rarely needs to be used directly; Access
is a more high-level trait
encompassing access to database. In particular, using snapshot()
method to convert
the implementation into &dyn Snapshot
is logically incorrect, because the snapshot
may not reflect the most recent state of RawAccess
.
Required Associated Types§
Required Methods§
Sourcefn snapshot(&self) -> &dyn Snapshot
fn snapshot(&self) -> &dyn Snapshot
Reference to a Snapshot
. This is the base relative to which the changes are defined.
Sourcefn changes(&self, address: &ResolvedAddress) -> Self::Changes
fn changes(&self, address: &ResolvedAddress) -> Self::Changes
Returns changes related to specific address
compared to the snapshot()
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.