shuttle_service

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§