pub trait TargetFactory: Send + Sync {
// Required methods
fn build<'async_trait>(
self: Arc<Self>,
data_collections: Vec<ExportDataCollectionSpec>,
declarations: Vec<Value>,
context: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<ExportDataCollectionBuildOutput>, Vec<(Value, Value)>)>> + Send + 'async_trait>>
where Self: 'async_trait;
fn diff_setup_states<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 Value,
desired_state: Option<Value>,
existing_states: CombinedState<Value>,
context: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ResourceSetupChange>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn normalize_setup_key(&self, key: &Value) -> Result<Value>;
fn check_state_compatibility(
&self,
desired_state: &Value,
existing_state: &Value,
) -> Result<SetupStateCompatibility>;
fn describe_resource(&self, key: &Value) -> Result<String>;
fn extract_additional_key(
&self,
key: &KeyValue,
value: &FieldValues,
export_context: &(dyn Any + Send + Sync),
) -> Result<Value>;
fn apply_mutation<'life0, 'async_trait>(
&'life0 self,
mutations: Vec<ExportTargetMutationWithContext<'async_trait, dyn Any + Send + Sync>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn apply_setup_changes<'life0, 'async_trait>(
&'life0 self,
setup_change: Vec<ResourceSetupChangeItem<'async_trait>>,
context: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
fn build<'async_trait>(
self: Arc<Self>,
data_collections: Vec<ExportDataCollectionSpec>,
declarations: Vec<Value>,
context: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<ExportDataCollectionBuildOutput>, Vec<(Value, Value)>)>> + Send + 'async_trait>>where
Self: 'async_trait,
Sourcefn diff_setup_states<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 Value,
desired_state: Option<Value>,
existing_states: CombinedState<Value>,
context: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ResourceSetupChange>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn diff_setup_states<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 Value,
desired_state: Option<Value>,
existing_states: CombinedState<Value>,
context: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ResourceSetupChange>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Will not be called if it’s setup by user. It returns an error if the target only supports setup by user.
Sourcefn normalize_setup_key(&self, key: &Value) -> Result<Value>
fn normalize_setup_key(&self, key: &Value) -> Result<Value>
Normalize the key. e.g. the JSON format may change (after code change, e.g. new optional field or field ordering), even if the underlying value is not changed. This should always return the canonical serialized form.