Skip to main content

ResolvableModel

Trait ResolvableModel 

Source
pub trait ResolvableModel:
    ByUuid
    + Serialize
    + DeserializeOwned
    + Send
    + Sync {
    type Fingerprint: Serialize + Send;

    // Required methods
    fn uuid(&self) -> Uuid;
    fn fingerprint(&self) -> Self::Fingerprint;
    fn resolve<'life0, 'life1, 'async_trait>(
        database: &'life0 Database,
        identifier: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn resolve_cached<'life0, 'life1, 'async_trait>(
        database: &'life0 Database,
        identifier: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Associated Types§

Required Methods§

Source

fn uuid(&self) -> Uuid

Source

fn fingerprint(&self) -> Self::Fingerprint

Source

fn resolve<'life0, 'life1, 'async_trait>( database: &'life0 Database, identifier: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn resolve_cached<'life0, 'life1, 'async_trait>( database: &'life0 Database, identifier: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§