DynamicDataSource

Trait DynamicDataSource 

Source
pub trait DynamicDataSource: Send + Sync {
    // Required methods
    fn schema(&self, diags: &mut Diagnostics) -> Option<Schema>;
    fn read<'life0, 'life1, 'async_trait>(
        &'life0 self,
        diags: &'life1 mut Diagnostics,
        config: RawValue,
        provider_meta_state: RawValue,
    ) -> Pin<Box<dyn Future<Output = Option<RawValue>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn validate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        diags: &'life1 mut Diagnostics,
        config: RawValue,
    ) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Trait for implementing a data source without automatic serialization/deserialization

See also: DataSource

Required Methods§

Source

fn schema(&self, diags: &mut Diagnostics) -> Option<Schema>

Get the schema of the data source

§Arguments
  • diags - Diagnostics to record warnings and errors that occured when getting back the schema
§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.

Source

fn read<'life0, 'life1, 'async_trait>( &'life0 self, diags: &'life1 mut Diagnostics, config: RawValue, provider_meta_state: RawValue, ) -> Pin<Box<dyn Future<Output = Option<RawValue>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read the new state of the data source

§Arguments
  • diags - Diagnostics to record warnings and errors that occured during the read
  • config - State as declared in the Terraform file
  • provider_meta_state - State of the provider metadata 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.

Provided Methods§

Source

fn validate<'life0, 'life1, 'async_trait>( &'life0 self, diags: &'life1 mut Diagnostics, config: RawValue, ) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate the configuration of the data source

§Arguments
  • diags - Diagnostics to record warnings and errors that occured during validation
  • config - 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.

Trait Implementations§

Source§

impl<T: DataSource + 'static> From<T> for Box<dyn DynamicDataSource>

Source§

fn from(value: T) -> Self

Converts to this type from the input type.

Implementors§