Skip to main content

Provider

Trait Provider 

Source
pub trait Provider: Send + Sync {
    // Required methods
    fn catalog(&self) -> ProviderCatalog;
    fn call<'life0, 'async_trait>(
        &'life0 self,
        call: ProviderCall,
    ) -> Pin<Box<dyn Future<Output = Result<ProviderOutput, ProviderError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn retire<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn suspend<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn runtime_status(&self) -> Option<Value> { ... }
    fn cancel_active(&self) -> bool { ... }
    fn reset_quarantine<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn deactivate(&self) { ... }
    fn activate(&self) { ... }
    fn acquire_dispatch(&self) -> bool { ... }
    fn release_dispatch(&self) { ... }
}

Required Methods§

Source

fn catalog(&self) -> ProviderCatalog

Source

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

Provided Methods§

Source

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

Stop accepting new work and release provider-owned runtime resources.

Stateless providers use the default no-op. Registries call this after an atomic generation swap, outside registry locks.

Source

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

Parks runtime resources while keeping a retained generation callable.

Source

fn runtime_status(&self) -> Option<Value>

Returns product-neutral operator status for a stateful runtime.

Source

fn cancel_active(&self) -> bool

Cancels active runtime work without waiting for the provider call lock.

Source

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

Clears runtime quarantine after explicit operator authorization.

Source

fn deactivate(&self)

Stops new work on a retained generation while in-flight work drains.

Source

fn activate(&self)

Re-enables a retained generation selected by operator rollback.

Source

fn acquire_dispatch(&self) -> bool

Acquires a dispatch lease while the provider is still active.

Registries call this while holding their generation read lock so an already-routed invocation can drain safely across an atomic swap.

Source

fn release_dispatch(&self)

Releases a dispatch lease acquired by Provider::acquire_dispatch.

Implementors§