pub trait Factory: Send + Sync {
    // Required methods
    fn get_db_connection<'life0, 'async_trait>(
        &'life0 mut self,
        db_type: Type
    ) -> Pin<Box<dyn Future<Output = Result<DatabaseReadyInfo, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn get_secrets<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<String, Secret<String>>, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn get_metadata(&self) -> DeploymentMetadata;
}
Expand description

Factories can be used to request the provisioning of additional resources (like databases).

An instance of factory is passed by the deployer as an argument to ResourceBuilder::output in the initial phase of deployment.

Also see the [shuttle_runtime::main] macro.

Required Methods§

source

fn get_db_connection<'life0, 'async_trait>( &'life0 mut self, db_type: Type ) -> Pin<Box<dyn Future<Output = Result<DatabaseReadyInfo, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get a database connection

source

fn get_secrets<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<String, Secret<String>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get all the secrets for a service

source

fn get_metadata(&self) -> DeploymentMetadata

Get the metadata for this deployment

Implementors§