Skip to main content

TargetAttachmentFactory

Trait TargetAttachmentFactory 

Source
pub trait TargetAttachmentFactory: Send + Sync {
    // Required methods
    fn normalize_setup_key(&self, key: &Value) -> Result<Value>;
    fn get_state(
        &self,
        target_name: &str,
        target_spec: &Map<String, Value>,
        attachment_spec: Value,
    ) -> Result<TargetAttachmentState>;
    fn diff_setup_states<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        target_key: &'life1 Value,
        attachment_key: &'life2 Value,
        new_state: Option<Value>,
        existing_states: CombinedState<Value>,
        context: &'life3 FlowInstanceContext,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn AttachmentSetupChange + Send + Sync>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}

Required Methods§

Source

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.

Source

fn get_state( &self, target_name: &str, target_spec: &Map<String, Value>, attachment_spec: Value, ) -> Result<TargetAttachmentState>

Source

fn diff_setup_states<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, target_key: &'life1 Value, attachment_key: &'life2 Value, new_state: Option<Value>, existing_states: CombinedState<Value>, context: &'life3 FlowInstanceContext, ) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn AttachmentSetupChange + Send + Sync>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Should return Some if and only if any changes are needed.

Implementors§