Trait shuttle_service::IntoResource

source ·
pub trait IntoResource<R>: Serialize + DeserializeOwned {
    // Required method
    fn into_resource<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Implement this on an ResourceInputBuilder::Output type to turn the base resource into the end type exposed to the Shuttle main function.

Required Methods§

source

fn into_resource<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Initialize any logic for creating the final resource of type R from the base resource.

Example: turn a connection string into a connection pool.

Object Safety§

This trait is not object safe.

Implementors§