Skip to main content

TargetSpecificAttachmentFactoryBase

Trait TargetSpecificAttachmentFactoryBase 

Source
pub trait TargetSpecificAttachmentFactoryBase:
    Send
    + Sync
    + 'static {
    type TargetKey: Debug + Clone + Serialize + DeserializeOwned + Eq + Hash + Send + Sync;
    type TargetSpec: DeserializeOwned + Send + Sync;
    type Spec: DeserializeOwned + Send + Sync;
    type SetupKey: Debug + Clone + Serialize + DeserializeOwned + Eq + Hash + Send + Sync;
    type SetupState: Debug + Clone + Serialize + DeserializeOwned + Send + Sync;
    type SetupChange: AttachmentSetupChange + Send + Sync;

    // Required methods
    fn name(&self) -> &str;
    fn get_state(
        &self,
        target_name: &str,
        target_spec: &Self::TargetSpec,
        attachment_spec: Self::Spec,
    ) -> Result<TypedTargetAttachmentState<Self>>;
    fn diff_setup_states<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        target_key: &'life1 Self::TargetKey,
        attachment_key: &'life2 Self::SetupKey,
        new_state: Option<Self::SetupState>,
        existing_states: CombinedState<Self::SetupState>,
        context: &'life3 FlowInstanceContext,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self::SetupChange>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;

    // Provided methods
    fn deserialize_setup_key(key: Value) -> Result<Self::SetupKey> { ... }
    fn register(self, registry: &mut ExecutorFactoryRegistry) -> Result<()>
       where Self: Sized { ... }
}
Expand description

A factory for target-specific attachments.

Required Associated Types§

Required Methods§

Source

fn name(&self) -> &str

Source

fn get_state( &self, target_name: &str, target_spec: &Self::TargetSpec, attachment_spec: Self::Spec, ) -> Result<TypedTargetAttachmentState<Self>>

Source

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

Provided Methods§

Source

fn deserialize_setup_key(key: Value) -> Result<Self::SetupKey>

Deserialize the setup key from a JSON value. You can override this method to provide a custom deserialization logic, e.g. to perform backward compatible deserialization.

Source

fn register(self, registry: &mut ExecutorFactoryRegistry) -> Result<()>
where Self: Sized,

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.

Implementors§