pub struct CapabilityRecord { /* private fields */ }Expand description
One locally known capability. Construction is pure: it computes the deterministic schema digest and bounds the compact descriptor, but never invokes the implementation factory.
Implementations§
Source§impl CapabilityRecord
impl CapabilityRecord
Sourcepub const SUMMARY_MAX_BYTES: usize = 256
pub const SUMMARY_MAX_BYTES: usize = 256
Byte budget for the compact summary (descriptor, not full schema).
Sourcepub const TAG_MAX_BYTES: usize = 32
pub const TAG_MAX_BYTES: usize = 32
Byte budget per retained tag.
pub fn new( id: ToolId, source: CapabilitySource, summary: &str, tags: Vec<String>, schema: SchemaLocator, factory: Arc<dyn Fn() -> Arc<dyn Tool> + Send + Sync>, provenance: TrustProvenance, ) -> CapabilityRecord
Sourcepub fn for_registered_tool(tool: &Arc<dyn Tool>) -> CapabilityRecord
pub fn for_registered_tool(tool: &Arc<dyn Tool>) -> CapabilityRecord
Catalog an already-constructed registry tool passively from its
declared ToolOrigin. Reads only in-process metadata (name,
description, parameters, origin): no execution, no extension
handler call, no MCP connection/process/network activity, no grant.
Runtime identities are encoded through the source-aware ToolId
constructors, so existing uppercase/Unicode/colon-bearing names are
represented exactly rather than rejected, and undeclared origins are
cataloged conservatively as unknown — never invented as builtin.
pub fn id(&self) -> &ToolId
pub fn source(&self) -> &CapabilitySource
pub fn summary(&self) -> &str
pub fn schema_locator(&self) -> &SchemaLocator
pub fn schema_digest(&self) -> &SchemaDigest
pub fn provenance(&self) -> &TrustProvenance
Sourcepub fn effect(&self) -> ToolEffect
pub fn effect(&self) -> ToolEffect
The recorded conservative effect class (Task 24, spec §8.2).
Sourcepub fn implementation(&self) -> Arc<dyn Tool> ⓘ
pub fn implementation(&self) -> Arc<dyn Tool> ⓘ
Construct the implementation. This is the ONLY place the stored factory is invoked; the catalog itself never calls it.
Trait Implementations§
Source§impl Clone for CapabilityRecord
impl Clone for CapabilityRecord
Source§fn clone(&self) -> CapabilityRecord
fn clone(&self) -> CapabilityRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for CapabilityRecord
impl !UnwindSafe for CapabilityRecord
impl Freeze for CapabilityRecord
impl Send for CapabilityRecord
impl Sync for CapabilityRecord
impl Unpin for CapabilityRecord
impl UnsafeUnpin for CapabilityRecord
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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