pub trait Provider:
Send
+ Sync
+ 'static {
type Config<'a>: Serialize + Deserialize<'a> + Send;
type MetaState<'a>: Serialize + Deserialize<'a> + Send;
// Required method
fn schema(&self, diags: &mut Diagnostics) -> Option<Schema>;
// Provided methods
fn validate<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
diags: &'life1 mut Diagnostics,
config: Self::Config<'a>,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn configure<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
diags: &'life1 mut Diagnostics,
terraform_version: String,
config: Self::Config<'a>,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn meta_schema(&self, diags: &mut Diagnostics) -> Option<Schema> { ... }
fn get_resources(
&self,
diags: &mut Diagnostics,
) -> Option<HashMap<String, Box<dyn DynamicResource>>> { ... }
fn get_data_sources(
&self,
diags: &mut Diagnostics,
) -> Option<HashMap<String, Box<dyn DynamicDataSource>>> { ... }
fn get_functions(
&self,
diags: &mut Diagnostics,
) -> Option<HashMap<String, Box<dyn DynamicFunction>>> { ... }
}Expand description
Trait for implementing a provider with automatic serialization/deserialization
See also: DynamicProvider
Required Associated Types§
Sourcetype Config<'a>: Serialize + Deserialize<'a> + Send
type Config<'a>: Serialize + Deserialize<'a> + Send
Configuration of the provider
The state will be automatically serialized/deserialized at the border of the request.
Sourcetype MetaState<'a>: Serialize + Deserialize<'a> + Send
type MetaState<'a>: Serialize + Deserialize<'a> + Send
State of the provider metadata
The metadata state will be automatically serialized/deserialized at the border of the request.
Required Methods§
Sourcefn schema(&self, diags: &mut Diagnostics) -> Option<Schema>
fn schema(&self, diags: &mut Diagnostics) -> Option<Schema>
Provided Methods§
Sourcefn validate<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
diags: &'life1 mut Diagnostics,
config: Self::Config<'a>,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
diags: &'life1 mut Diagnostics,
config: Self::Config<'a>,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate the configuration of the provider
§Arguments
diags- Diagnostics to record warnings and errors that occured during validationconfig- State as declared in the Terraform file
§Remarks
The return is ignored if there is an error in diagnostics.
If the return is None, an ad-hoc error is added to diagnostics.
Sourcefn configure<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
diags: &'life1 mut Diagnostics,
terraform_version: String,
config: Self::Config<'a>,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn configure<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
diags: &'life1 mut Diagnostics,
terraform_version: String,
config: Self::Config<'a>,
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Configure the provider
§Arguments
diags- Diagnostics to record warnings and errors that occured during validationterraform_version- Version of the Terraform binary that calls the providerconfig- State as declared in the Terraform file
§Remarks
The return is ignored if there is an error in diagnostics.
If the return is None, an ad-hoc error is added to diagnostics.
Sourcefn meta_schema(&self, diags: &mut Diagnostics) -> Option<Schema>
fn meta_schema(&self, diags: &mut Diagnostics) -> Option<Schema>
Sourcefn get_resources(
&self,
diags: &mut Diagnostics,
) -> Option<HashMap<String, Box<dyn DynamicResource>>>
fn get_resources( &self, diags: &mut Diagnostics, ) -> Option<HashMap<String, Box<dyn DynamicResource>>>
Sourcefn get_data_sources(
&self,
diags: &mut Diagnostics,
) -> Option<HashMap<String, Box<dyn DynamicDataSource>>>
fn get_data_sources( &self, diags: &mut Diagnostics, ) -> Option<HashMap<String, Box<dyn DynamicDataSource>>>
Sourcefn get_functions(
&self,
diags: &mut Diagnostics,
) -> Option<HashMap<String, Box<dyn DynamicFunction>>>
fn get_functions( &self, diags: &mut Diagnostics, ) -> Option<HashMap<String, Box<dyn DynamicFunction>>>
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.