pub struct ToolRouter<S> {
pub map: HashMap<Cow<'static, str>, ToolRoute<S>>,
pub transparent_when_not_found: bool,
}Fields§
§map: HashMap<Cow<'static, str>, ToolRoute<S>>§transparent_when_not_found: boolImplementations§
Source§impl<S> ToolRouter<S>
impl<S> ToolRouter<S>
pub fn new() -> ToolRouter<S>
pub fn with_route<R, A>(self, route: R) -> ToolRouter<S>where
R: IntoToolRoute<S, A>,
pub fn add_route(&mut self, item: ToolRoute<S>)
pub fn merge(&mut self, other: ToolRouter<S>)
pub fn remove_route(&mut self, name: &str)
pub fn has_route(&self, name: &str) -> bool
pub async fn call( &self, context: ToolCallContext<'_, S>, ) -> Result<CallToolResult, ErrorData>
pub fn list_all(&self) -> Vec<Tool>
Trait Implementations§
Source§impl<S> Add for ToolRouter<S>
impl<S> Add for ToolRouter<S>
Source§type Output = ToolRouter<S>
type Output = ToolRouter<S>
The resulting type after applying the
+ operator.Source§fn add(self, other: ToolRouter<S>) -> <ToolRouter<S> as Add>::Output
fn add(self, other: ToolRouter<S>) -> <ToolRouter<S> as Add>::Output
Performs the
+ operation. Read moreSource§impl<S> AddAssign for ToolRouter<S>
impl<S> AddAssign for ToolRouter<S>
Source§fn add_assign(&mut self, other: ToolRouter<S>)
fn add_assign(&mut self, other: ToolRouter<S>)
Performs the
+= operation. Read moreSource§impl<S> Clone for ToolRouter<S>
impl<S> Clone for ToolRouter<S>
Source§fn clone(&self) -> ToolRouter<S>
fn clone(&self) -> ToolRouter<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S> Debug for ToolRouter<S>where
S: Debug,
impl<S> Debug for ToolRouter<S>where
S: Debug,
Source§impl<S> Default for ToolRouter<S>
impl<S> Default for ToolRouter<S>
Source§fn default() -> ToolRouter<S>
fn default() -> ToolRouter<S>
Returns the “default value” for a type. Read more
Source§impl<S> IntoIterator for ToolRouter<S>
impl<S> IntoIterator for ToolRouter<S>
Source§type IntoIter = IntoValues<Cow<'static, str>, ToolRoute<S>>
type IntoIter = IntoValues<Cow<'static, str>, ToolRoute<S>>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <ToolRouter<S> as IntoIterator>::IntoIter
fn into_iter(self) -> <ToolRouter<S> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Auto Trait Implementations§
impl<S> !RefUnwindSafe for ToolRouter<S>
impl<S> !UnwindSafe for ToolRouter<S>
impl<S> Freeze for ToolRouter<S>
impl<S> Send for ToolRouter<S>
impl<S> Sync for ToolRouter<S>
impl<S> Unpin for ToolRouter<S>
impl<S> UnsafeUnpin for ToolRouter<S>
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