pub struct ToolRegistry { /* private fields */ }Expand description
Canonical tool registry — single source of truth.
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
pub fn new() -> Self
Sourcepub async fn schemas(&self) -> Vec<ToolSchema>
pub async fn schemas(&self) -> Vec<ToolSchema>
Get all tool schemas (for model prompt generation).
Sourcepub async fn allowed_schemas(&self) -> Vec<ToolSchema>
pub async fn allowed_schemas(&self) -> Vec<ToolSchema>
Get schemas filtered by permission (e.g., only non-denied tools for model).
Sourcepub async fn by_source(&self, source_match: &ToolSource) -> Vec<ToolEntry>
pub async fn by_source(&self, source_match: &ToolSource) -> Vec<ToolEntry>
Get tools by source type.
Sourcepub async fn by_category(&self, category: &str) -> Vec<ToolEntry>
pub async fn by_category(&self, category: &str) -> Vec<ToolEntry>
Get tools by category.
Sourcepub async fn validate(&self) -> Vec<RegistryValidationError>
pub async fn validate(&self) -> Vec<RegistryValidationError>
Validate all entries — check for common issues.
Sourcepub async fn to_schema_map(&self) -> HashMap<String, ToolSchema>
pub async fn to_schema_map(&self) -> HashMap<String, ToolSchema>
Export the full HashMap of schemas (for backward compat with Runtime.tools).
pub async fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ToolRegistry
impl !RefUnwindSafe for ToolRegistry
impl Send for ToolRegistry
impl Sync for ToolRegistry
impl Unpin for ToolRegistry
impl UnsafeUnpin for ToolRegistry
impl !UnwindSafe for ToolRegistry
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> 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>
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