pub struct StaticRustProvider { /* private fields */ }Expand description
Provider exposing Soma’s built-in Rust actions (from ACTION_SPECS) as a
catalog and dispatching calls through the shared SomaService.
Implementations§
Source§impl StaticRustProvider
impl StaticRustProvider
Sourcepub fn new(service: SomaService) -> Self
pub fn new(service: SomaService) -> Self
Builds the provider over the given service with the built-in catalog.
Sourcepub fn catalog_static() -> ProviderCatalog
pub fn catalog_static() -> ProviderCatalog
Returns the built-in action catalog without constructing a provider.
Trait Implementations§
Source§impl Clone for StaticRustProvider
impl Clone for StaticRustProvider
Source§fn clone(&self) -> StaticRustProvider
fn clone(&self) -> StaticRustProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Provider for StaticRustProvider
impl Provider for StaticRustProvider
Source§fn catalog(&self) -> ProviderCatalog
fn catalog(&self) -> ProviderCatalog
The provider’s catalog — its tools, prompts, resources, and metadata.
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,
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.
Source§fn 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.Source§fn 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.Source§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,
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).Auto Trait Implementations§
impl Freeze for StaticRustProvider
impl !RefUnwindSafe for StaticRustProvider
impl Send for StaticRustProvider
impl Sync for StaticRustProvider
impl Unpin for StaticRustProvider
impl UnsafeUnpin for StaticRustProvider
impl !UnwindSafe for StaticRustProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more