#[non_exhaustive]pub struct ToolRoute<S> {
pub call: Arc<DynCallToolHandler<S>>,
pub attr: Tool,
}Available on crate feature
server only.Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.call: Arc<DynCallToolHandler<S>>§attr: ToolImplementations§
Source§impl<S: MaybeSend + 'static> ToolRoute<S>
impl<S: MaybeSend + 'static> ToolRoute<S>
pub fn new<C, A>(attr: impl Into<Tool>, call: C) -> Selfwhere
C: CallToolHandler<S, A> + MaybeSend + Clone + 'static,
pub fn new_dyn<C>(attr: impl Into<Tool>, call: C) -> Selfwhere
C: for<'a> Fn(ToolCallContext<'a, S>) -> BoxFuture<'a, Result<CallToolResponse, ErrorData>> + MaybeSend + 'static,
pub fn name(&self) -> &str
Trait Implementations§
Source§impl<S> IntoToolRoute<S, ()> for ToolRoute<S>where
S: MaybeSend + 'static,
impl<S> IntoToolRoute<S, ()> for ToolRoute<S>where
S: MaybeSend + 'static,
fn into_tool_route(self) -> ToolRoute<S>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for ToolRoute<S>
impl<S> !UnwindSafe for ToolRoute<S>
impl<S> Freeze for ToolRoute<S>
impl<S> Send for ToolRoute<S>
impl<S> Sync for ToolRoute<S>
impl<S> Unpin for ToolRoute<S>
impl<S> UnsafeUnpin for ToolRoute<S>where
Arc<dyn for<'s> Fn(ToolCallContext<'s, S>) -> Pin<Box<dyn Future<Output = Result<CallToolResponse, ErrorData>> + Send + 's>> + Send + Sync>: UnsafeUnpin,
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