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§
Sourcetype AtRevision: DatabaseAtRevision
type AtRevision: DatabaseAtRevision
The type of database view at a specific revision.
Required Methods§
Sourcefn local_database(&self) -> Self::AtRevision
fn local_database(&self) -> Self::AtRevision
Get the latest local database
Sourcefn latest_database(
&self,
) -> impl Future<Output = Result<Self::AtRevision, DatabaseError>>
fn latest_database( &self, ) -> impl Future<Output = Result<Self::AtRevision, DatabaseError>>
Get the latest revision on the server committed to storage.
Sourcefn database_at_revision(
&self,
revision: u64,
) -> impl Future<Output = Result<Self::AtRevision, DatabaseError>>
fn database_at_revision( &self, revision: u64, ) -> impl Future<Output = Result<Self::AtRevision, DatabaseError>>
Get the database at a specific revision, awaiting if necessary.
Sourcefn database_at_timestamp(
&self,
revision_timestamp: DateTime<Utc>,
) -> impl Future<Output = Result<Self::AtRevision, DatabaseError>>
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.