DatabaseProvider

Trait DatabaseProvider 

Source
pub trait DatabaseProvider: DatabaseIdentity {
    type AtRevision: DatabaseAtRevision;

    // Required methods
    fn local_database(&self) -> Self::AtRevision;
    fn latest_database(
        &self,
    ) -> impl Future<Output = Result<Self::AtRevision, DatabaseError>>;
    fn database_at_revision(
        &self,
        revision: u64,
    ) -> impl Future<Output = Result<Self::AtRevision, DatabaseError>>;
    fn database_at_timestamp(
        &self,
        revision_timestamp: DateTime<Utc>,
    ) -> impl Future<Output = Result<Self::AtRevision, DatabaseError>>;
}
Expand description

Provides access to database views at various revisions.

Required Associated Types§

Source

type AtRevision: DatabaseAtRevision

The type of database view at a specific revision.

Required Methods§

Source

fn local_database(&self) -> Self::AtRevision

Get the latest local database

Source

fn latest_database( &self, ) -> impl Future<Output = Result<Self::AtRevision, DatabaseError>>

Get the latest revision on the server committed to storage.

Source

fn database_at_revision( &self, revision: u64, ) -> impl Future<Output = Result<Self::AtRevision, DatabaseError>>

Get the database at a specific revision, awaiting if necessary.

Source

fn database_at_timestamp( &self, revision_timestamp: DateTime<Utc>, ) -> impl Future<Output = Result<Self::AtRevision, DatabaseError>>

Get the database at the revision effective at a specific timestamp.

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.

Implementors§

Source§

impl DatabaseProvider for Connection

Source§

type AtRevision = DatabaseAtRevisionImpl