pub struct BuiltinToolRegistry { /* private fields */ }Expand description
内置工具注册表
管理所有内置工具的注册和查找。
Implementations§
Source§impl BuiltinToolRegistry
impl BuiltinToolRegistry
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
创建并注册所有默认工具
Sourcepub fn register(&mut self, tool: Box<dyn BuiltinTool>)
pub fn register(&mut self, tool: Box<dyn BuiltinTool>)
注册工具
Sourcepub fn get(&self, name: &str) -> Option<&dyn BuiltinTool>
pub fn get(&self, name: &str) -> Option<&dyn BuiltinTool>
获取工具
Sourcepub fn list(&self) -> Vec<&dyn BuiltinTool>
pub fn list(&self) -> Vec<&dyn BuiltinTool>
列出所有工具
Sourcepub fn list_by_category(&self, category: ToolCategory) -> Vec<&dyn BuiltinTool>
pub fn list_by_category(&self, category: ToolCategory) -> Vec<&dyn BuiltinTool>
按分类列出工具
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BuiltinToolRegistry
impl !UnwindSafe for BuiltinToolRegistry
impl Freeze for BuiltinToolRegistry
impl Send for BuiltinToolRegistry
impl Sync for BuiltinToolRegistry
impl Unpin for BuiltinToolRegistry
impl UnsafeUnpin for BuiltinToolRegistry
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