pub trait Provider: Send + Sync {
Show 14 methods
// 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) { ... }
fn dynamic_resource_templates(&self) -> Vec<DynamicResourceTemplate> { ... }
fn supports_resource_reads(&self) -> bool { ... }
fn read_resource<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
uri: &'life1 str,
params: &'life2 BTreeMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<ResourceReadOutput, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
A loaded provider: exposes a catalog and dispatches action calls, with optional MCP resource-read support layered on top.
Required Methods§
Sourcefn catalog(&self) -> ProviderCatalog
fn catalog(&self) -> ProviderCatalog
The provider’s catalog — its tools, prompts, resources, and metadata.
Sourcefn 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,
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,
Executes one provider action call and returns its output.
Provided Methods§
Sourcefn retire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn retire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Drains and releases provider-owned runtime resources after a registry generation swap.
Sourcefn suspend<'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,
Parks runtime resources while preserving rollback capability.
Sourcefn runtime_status(&self) -> Option<Value>
fn runtime_status(&self) -> Option<Value>
Returns product-neutral operator status for a stateful runtime.
Sourcefn cancel_active(&self) -> bool
fn cancel_active(&self) -> bool
Cancels active work without waiting for provider dispatch to complete.
Sourcefn reset_quarantine<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.
Sourcefn deactivate(&self)
fn deactivate(&self)
Stops new work while in-flight work drains on a retained generation.
Sourcefn acquire_dispatch(&self) -> bool
fn acquire_dispatch(&self) -> bool
Reserves an invocation while this provider is still active.
Sourcefn release_dispatch(&self)
fn release_dispatch(&self)
Releases a reservation acquired by Provider::acquire_dispatch.
Sourcefn dynamic_resource_templates(&self) -> Vec<DynamicResourceTemplate>
fn dynamic_resource_templates(&self) -> Vec<DynamicResourceTemplate>
Dynamic resource templates this provider serves. Every provider
inherits the empty default — only file-based dynamic resource
readers (providers/resources/*.ts) override it.
Sourcefn supports_resource_reads(&self) -> bool
fn supports_resource_reads(&self) -> bool
Whether this provider can actually serve read_resource calls.
catalog().resources is a schema-legal field on every provider
kind’s manifest (OpenAPI, MCP, ai-sdk, WASM, Python, generic JSON),
but only file-based ResourceFileProviders have any mechanism to
read content back — every other kind inherits read_resource’s
default error. ResourceIndex::register uses this to reject a
manifest that declares resources it can never serve at snapshot-build
time, rather than letting them appear in resources/list and always
fail resources/read with an opaque error.
Sourcefn read_resource<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
uri: &'life1 str,
params: &'life2 BTreeMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<ResourceReadOutput, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn read_resource<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
uri: &'life1 str,
params: &'life2 BTreeMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<ResourceReadOutput, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Reads resource content for a URI the registry has already matched
against either this provider’s catalog().resources (exact,
params empty) or one of its dynamic_resource_templates()
(params holds captured path parameters).