pub trait CapabilityInvoker {
// Required methods
fn granted(&self) -> Vec<String>;
fn invoke(&self, capability: &str, input: Value) -> CapabilityCallResult;
// Provided methods
fn is_granted(&self, capability: &str) -> bool { ... }
fn describe(&self, capability: &str) -> Option<CapabilityDescription> { ... }
}Expand description
The boundary between this interpreter and the real world.
Implementations decide what a “capability” is: a direct Wasm component call, a broker proposal, or a test fixture. This crate never learns which.
Required Methods§
Sourcefn granted(&self) -> Vec<String>
fn granted(&self) -> Vec<String>
Returns every capability identifier currently available to invoke.
Sourcefn invoke(&self, capability: &str, input: Value) -> CapabilityCallResult
fn invoke(&self, capability: &str, input: Value) -> CapabilityCallResult
Invokes one capability synchronously.
This is deliberately synchronous: this crate carries no async runtime dependency, and the
calling binary’s model tool loop is untouched. An implementation that is asynchronous
underneath bridges here itself, which is what dekopon-run does from its blocking task.
Provided Methods§
Sourcefn is_granted(&self, capability: &str) -> bool
fn is_granted(&self, capability: &str) -> bool
Reports whether one capability identifier is available, for dispatch-time lookup.
The default scans CapabilityInvoker::granted; override it when a cheaper lookup exists.
Sourcefn describe(&self, capability: &str) -> Option<CapabilityDescription>
fn describe(&self, capability: &str) -> Option<CapabilityDescription>
Returns model-facing metadata for one capability, when the implementation has any.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".