Trait shuttle_runtime::Factory
source · 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, 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§
sourcefn 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_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
sourcefn get_secrets<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<String, String>, 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, String>, Error>> + Send + 'async_trait>>where 'life0: 'async_trait, Self: 'async_trait,
Get all the secrets for a service
sourcefn get_metadata(&self) -> DeploymentMetadata
fn get_metadata(&self) -> DeploymentMetadata
Get the metadata for this deployment