Trait Reconciler

Source
pub trait Reconciler<CONTEXT: Send + Sync, ERROR: Error + Send + Sync, RESOURCE: Clone + Debug + DeserializeOwned + Resource<DynamicType = ()> + Send + Sync>: Send + Sync {
    // Required methods
    fn reconcile_creation_or_update(
        &self,
        res: Arc<RESOURCE>,
        ctx: Arc<CONTEXT>,
    ) -> impl Future<Output = Result<Action, ERROR>> + Send;
    fn reconcile_deletion(
        &self,
        res: Arc<RESOURCE>,
        ctx: Arc<CONTEXT>,
    ) -> impl Future<Output = Result<Action, ERROR>> + Send;
}
Expand description

A reconciler.

Required Methods§

Source

fn reconcile_creation_or_update( &self, res: Arc<RESOURCE>, ctx: Arc<CONTEXT>, ) -> impl Future<Output = Result<Action, ERROR>> + Send

Handle a resource creation/update. Arguments:

  • res: the resource
  • ctx: the context of the application
Source

fn reconcile_deletion( &self, res: Arc<RESOURCE>, ctx: Arc<CONTEXT>, ) -> impl Future<Output = Result<Action, ERROR>> + Send

Handle a resource deletion. Arguments:

  • res: the resource
  • ctx: the context of the application

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§

Source§

impl<CONTEXT: Send + Sync + 'static, ERROR: Error + Send + Sync + 'static, RESOURCE: Clone + Debug + DeserializeOwned + Resource<DynamicType = ()> + Send + Sync + 'static, TASK: Task<CONTEXT, ERROR, RESOURCE> + 'static> Reconciler<CONTEXT, ERROR, RESOURCE> for DagReconciler<CONTEXT, ERROR, RESOURCE, TASK>