Skip to main content

SetupOperator

Trait SetupOperator 

Source
pub trait SetupOperator:
    'static
    + Send
    + Sync {
    type Key: Debug + Hash + Eq + Clone + Send + Sync;
    type State: State<Self::Key>;
    type SetupState: Send + Sync + IntoIterator<Item = Self::State>;
    type Context: Sync;

    // Required methods
    fn describe_key(&self, key: &Self::Key) -> String;
    fn describe_state(&self, state: &Self::State) -> String;
    fn is_up_to_date(
        &self,
        current: &Self::State,
        desired: &Self::State,
    ) -> bool;
    fn create<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        state: &'life1 Self::State,
        context: &'life2 Self::Context,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 Self::Key,
        context: &'life2 Self::Context,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn update<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        state: &'life1 Self::State,
        context: &'life2 Self::Context,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}

Required Associated Types§

Required Methods§

Source

fn describe_key(&self, key: &Self::Key) -> String

Source

fn describe_state(&self, state: &Self::State) -> String

Source

fn is_up_to_date(&self, current: &Self::State, desired: &Self::State) -> bool

Source

fn create<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 Self::State, context: &'life2 Self::Context, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn delete<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 Self::Key, context: &'life2 Self::Context, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn update<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 Self::State, context: &'life2 Self::Context, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§