Trait vm_resource::AsyncResolveResource

source ·
pub trait AsyncResolveResource<K: CanResolveTo<Self::Output>, T>: Send + Sync {
    type Output;
    type Error: Into<Box<dyn Error + Send + Sync>>;

    // Required method
    fn resolve<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        resolver: &'life1 ResourceResolver,
        resource: T,
        input: K::Input<'life2>,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait implemented to resolve resource type T as resource kind K.

Unlike ResolveResource, this allows for async operation, including calling into other resource resolvers to resolve sub-resources.

Required Associated Types§

source

type Output

The output type for resource resolution.

source

type Error: Into<Box<dyn Error + Send + Sync>>

The error type for resolve.

Required Methods§

source

fn resolve<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, resolver: &'life1 ResourceResolver, resource: T, input: K::Input<'life2>, ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Resolves the resource.

resolver can be used to resolve sub-resources.

Object Safety§

This trait is not object safe.

Implementors§