Skip to main content

Adapter

Trait Adapter 

Source
pub trait Adapter: Observer + Emitter {
    // Provided methods
    fn ensure_schema<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _schema: &'life1 Schema,
    ) -> Pin<Box<dyn Future<Output = Result<ProvisionReport>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn preview_schema<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _schema: &'life1 Schema,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ProvisionReport>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

full adapter contract for read+write backends; may also provision schema.

Provided Methods§

Source

fn ensure_schema<'life0, 'life1, 'async_trait>( &'life0 self, _schema: &'life1 Schema, ) -> Pin<Box<dyn Future<Output = Result<ProvisionReport>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn preview_schema<'life0, 'life1, 'async_trait>( &'life0 self, _schema: &'life1 Schema, ) -> Pin<Box<dyn Future<Output = Result<Option<ProvisionReport>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

read-only counterpart to Adapter::ensure_schema: report what provisioning apply would perform, writing nothing. None means this adapter cannot preview schema (reported honestly, never as “no schema changes”); Some(report) is the provisioning it would carry out, Some(empty) that there is nothing to provision.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§