Trait RawAccess

Source
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§

Source

type Changes: ChangeSet

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

Required Methods§

Source

fn snapshot(&self) -> &dyn Snapshot

Reference to a Snapshot. This is the base relative to which the changes are defined.

Source

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.

Implementations on Foreign Types§

Source§

impl RawAccess for &Box<dyn Snapshot>

Source§

type Changes = ()

Source§

fn snapshot(&self) -> &dyn Snapshot

Source§

fn changes(&self, _address: &ResolvedAddress) -> Self::Changes

Source§

impl RawAccess for Rc<Fork>

Source§

type Changes = ChangesMut<'static>

Source§

fn snapshot(&self) -> &dyn Snapshot

Source§

fn changes(&self, address: &ResolvedAddress) -> Self::Changes

Source§

impl RawAccess for Rc<dyn Snapshot>

Source§

type Changes = ()

Source§

fn snapshot(&self) -> &dyn Snapshot

Source§

fn changes(&self, _address: &ResolvedAddress) -> Self::Changes

Source§

impl RawAccess for Arc<dyn Snapshot>

Source§

type Changes = ()

Source§

fn snapshot(&self) -> &dyn Snapshot

Source§

fn changes(&self, _address: &ResolvedAddress) -> Self::Changes

Implementors§

Source§

impl RawAccess for &Patch

Source§

impl RawAccess for &dyn Snapshot

Source§

impl RawAccess for OwnedReadonlyFork

Source§

type Changes = ChangesRef<'static>

Source§

impl<'a> RawAccess for &'a Fork

Source§

type Changes = ChangesMut<'a>

Source§

impl<'a> RawAccess for GenericRawAccess<'a>

Source§

type Changes = GenericChanges<'a>

Source§

impl<'a> RawAccess for ReadonlyFork<'a>

Source§

type Changes = ChangesRef<'a>