pub struct ToolRegistry {
tools: Vec<Box<dyn Tool>>,
}Expand description
Registry for tools (built-in, Lua, and custom Rust).
Use ToolRegistry::with_builtins to create a registry pre-loaded
with the core search, get, and sources tools, then optionally
call register to add custom ones.
§Example
use context_harness::traits::ToolRegistry;
let mut tools = ToolRegistry::with_builtins();
// tools.register(Box::new(MyTool::new()));Fields§
§tools: Vec<Box<dyn Tool>>Implementations§
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn with_builtins() -> Self
pub fn with_builtins() -> Self
Create a tool registry pre-loaded with built-in tools (search, get, sources).
Sourcepub fn with_builtins_multi() -> Self
pub fn with_builtins_multi() -> Self
Create a tool registry with the router-aware built-ins for
multi-workspace mode: search/get/sources accept a workspace
selector and the workspaces discovery tool is added. Workspace-local
Lua/Rust tools are intentionally not registered in multi mode in Phase 1
(SPEC-0014 R54).
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
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().