Skip to main content

ElementRuntime

Trait ElementRuntime 

Source
pub trait ElementRuntime:
    Send
    + Sync
    + 'static {
    // Required methods
    fn materialize<'life0, 'life1, 'async_trait>(
        &'life0 self,
        resolved: &'life1 ResolvedConfiguration,
    ) -> Pin<Box<dyn Future<Output = Result<MaterializationOutputs>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn dematerialize<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn status_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = LiveStatusSummary> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn observe_state(
        &self,
        listener: StateTransitionListener,
    ) -> Box<dyn StateObservation>;

    // Provided methods
    fn on_trial_starting<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 TrialContext,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn on_trial_ending<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 TrialContext,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

The async behavioural surface of an element.

Implementations live in the hyperplane tier (one per element type). Paramodel ships a mock implementation in paramodel-mock for TCK tests.

Required Methods§

Source

fn materialize<'life0, 'life1, 'async_trait>( &'life0 self, resolved: &'life1 ResolvedConfiguration, ) -> Pin<Box<dyn Future<Output = Result<MaterializationOutputs>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provision the element’s concrete resources.

resolved carries fully interpolated configuration. Returns typed values keyed by result_parameters names.

Source

fn dematerialize<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Release the element’s provisioned resources. Idempotent.

Source

fn status_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = LiveStatusSummary> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Report the element’s current operational state.

Source

fn observe_state( &self, listener: StateTransitionListener, ) -> Box<dyn StateObservation>

Register a state-transition listener.

Implementations deliver a synthetic Unknown → current transition immediately so the observer doesn’t miss the current state.

Provided Methods§

Source

fn on_trial_starting<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: &'life1 TrialContext, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Trial is starting — hook for per-trial setup. Default no-op.

Source

fn on_trial_ending<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: &'life1 TrialContext, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Trial is ending — hook for per-trial teardown. Default no-op.

Implementors§