Skip to main content

Provider

Trait Provider 

Source
pub trait Provider:
    Send
    + Sync
    + 'static {
    type ListResourceStream: Stream<Item = Result<Event, Status>> + Send + 'static;
    type InvokeActionStream: Stream<Item = Result<Event, Status>> + Send + 'static;

Show 28 methods // Required methods fn get_metadata<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_schema<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn prepare_provider_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn validate_resource_type_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn validate_data_source_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn upgrade_resource_state<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_resource_identity_schemas<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn upgrade_resource_identity<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn configure<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn read_resource<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn plan_resource_change<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn apply_resource_change<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn import_resource_state<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn move_resource_state<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn read_data_source<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn generate_resource_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn validate_ephemeral_resource_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn open_ephemeral_resource<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn renew_ephemeral_resource<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn close_ephemeral_resource<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_resource<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListResourceStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn validate_list_resource_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_functions<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn call_function<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn plan_action<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn invoke_action<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::InvokeActionStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn validate_action_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn stop<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with ProviderServer.

Required Associated Types§

Source

type ListResourceStream: Stream<Item = Result<Event, Status>> + Send + 'static

Server streaming response type for the ListResource method.

Source

type InvokeActionStream: Stream<Item = Result<Event, Status>> + Send + 'static

Server streaming response type for the InvokeAction method.

Required Methods§

Source

fn get_metadata<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

GetMetadata returns upfront information about server capabilities and supported resource types without requiring the server to instantiate all schema information, which may be memory intensive. This method is CURRENTLY UNUSED and it serves mostly for convenience of code generation inside of terraform-plugin-mux.

Source

fn get_schema<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

GetSchema returns schema information for the provider, data resources, and managed resources.

Source

fn prepare_provider_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn validate_resource_type_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn validate_data_source_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn upgrade_resource_state<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_resource_identity_schemas<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

GetResourceIdentitySchemas returns the identity schemas for all managed resources.

Source

fn upgrade_resource_identity<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

UpgradeResourceIdentityData should return the upgraded resource identity data for a managed resource type.

Source

fn configure<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

////// One-time initialization, called before other functions below

Source

fn read_resource<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

////// Managed Resource Lifecycle

Source

fn plan_resource_change<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn apply_resource_change<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn import_resource_state<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn move_resource_state<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn read_data_source<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn generate_resource_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn validate_ephemeral_resource_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

////// Ephemeral Resource Lifecycle

Source

fn open_ephemeral_resource<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn renew_ephemeral_resource<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn close_ephemeral_resource<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn list_resource<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListResourceStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

///// List

Source

fn validate_list_resource_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_functions<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

GetFunctions returns the definitions of all functions.

Source

fn call_function<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

////// Provider-contributed Functions

Source

fn plan_action<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

////// Actions

Source

fn invoke_action<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::InvokeActionStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn validate_action_config<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn stop<'life0, 'async_trait>( &'life0 self, request: Request<Request>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

////// Graceful Shutdown

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§