Skip to main content

Resource

Trait Resource 

Source
pub trait Resource: Send {
    type Output: Send;

    // Required method
    fn load(
        self,
        runtime: &Runtime,
    ) -> impl Future<Output = Result<Self::Output, RuntimeError>> + Send;
}
Expand description

Loads one resource using the selected runtime policy and project.

Implementations return a concrete output and a Send future without boxing.

Required Associated Types§

Source

type Output: Send

Value returned after the resource has been prepared.

Required Methods§

Source

fn load( self, runtime: &Runtime, ) -> impl Future<Output = Result<Self::Output, RuntimeError>> + Send

Resolves and prepares this resource for the runtime.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§