Trait oas_common::resolver::Resolver  
source · [−]pub trait Resolver {
    type Error: Error + Send + Sync + 'static;
    fn resolve<'life0, 'life1, 'async_trait, T: TypedValue>(
        &'life0 self,
        id: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Record<T>, Self::Error>> + Send + 'async_trait>>
    where
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait;
    fn resolve_all<'life0, 'life1, 'life2, 'async_trait, T: TypedValue + Send>(
        &'life0 self,
        ids: &'life1 [&'life2 str]
    ) -> Pin<Box<dyn Future<Output = Vec<Result<Record<T>, Self::Error>>> + Send + 'async_trait>>
    where
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: Sync + 'async_trait,
    { ... }
    fn resolve_all_refs<'life0, 'life1, 'async_trait, T: Resolvable + Send>(
        &'life0 self,
        records: &'life1 mut [Record<T>]
    ) -> Pin<Box<dyn Future<Output = Result<(), MissingRefsError>> + Send + 'async_trait>>
    where
        Self: Sized + Send,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait,
    { ... }
    fn resolve_refs<'life0, 'life1, 'async_trait, T: TypedValue + Send>(
        &'life0 self,
        references: &'life1 mut [Reference<T>]
    ) -> Pin<Box<dyn Future<Output = Result<(), MissingRefsError>> + Send + 'async_trait>>
    where
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait,
    { ... }
}Expand description
A trait to be implemented on data stores that can resolve records by their type and id strings.
Required Associated Types
Required Methods
Resolve (load) a single record by its id.
Provided Methods
sourcefn resolve_all<'life0, 'life1, 'life2, 'async_trait, T: TypedValue + Send>(
    &'life0 self,
    ids: &'life1 [&'life2 str]
) -> Pin<Box<dyn Future<Output = Vec<Result<Record<T>, Self::Error>>> + Send + 'async_trait>>where
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: Sync + 'async_trait,
fn resolve_all<'life0, 'life1, 'life2, 'async_trait, T: TypedValue + Send>(
    &'life0 self,
    ids: &'life1 [&'life2 str]
) -> Pin<Box<dyn Future<Output = Vec<Result<Record<T>, Self::Error>>> + Send + 'async_trait>>where
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: Sync + 'async_trait,
Resolve (load) all records with their ids.
The method is generic over the record type, thus only supports loading records of a single type.
sourcefn resolve_all_refs<'life0, 'life1, 'async_trait, T: Resolvable + Send>(
fn resolve_all_refs<'life0, 'life1, 'async_trait, T: Resolvable + Send>(
    &'life0 self,
    records: &'life1 mut [Record<T>]
) -> Pin<Box<dyn Future<Output = Result<(), MissingRefsError>> + Send + 'async_trait>>where
    Self: Sized + Send,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: Sync + 'async_trait,
sourcefn resolve_refs<'life0, 'life1, 'async_trait, T: TypedValue + Send>(
    &'life0 self,
    references: &'life1 mut [Reference<T>]
) -> Pin<Box<dyn Future<Output = Result<(), MissingRefsError>> + Send + 'async_trait>>where
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: Sync + 'async_trait,
fn resolve_refs<'life0, 'life1, 'async_trait, T: TypedValue + Send>(
    &'life0 self,
    references: &'life1 mut [Reference<T>]
) -> Pin<Box<dyn Future<Output = Result<(), MissingRefsError>> + Send + 'async_trait>>where
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: Sync + 'async_trait,
Resolve a list of references.