pub struct ToolDef {
pub spec: ToolSpec,
pub callable: ToolCallable,
pub prerequisites: Vec<PrerequisiteSpec>,
}Expand description
Binds a tool spec to a callable with optional prerequisites.
Fields§
§spec: ToolSpecThe tool schema/specification.
callable: ToolCallableThe asynchronous function pointer executing the tool.
prerequisites: Vec<PrerequisiteSpec>Optional dependencies/prerequisites for this tool.
Implementations§
Source§impl ToolDef
impl ToolDef
Sourcepub fn new<C>(spec: ToolSpec, callable: C) -> Selfwhere
C: IntoToolCallable,
pub fn new<C>(spec: ToolSpec, callable: C) -> Selfwhere
C: IntoToolCallable,
Creates a new ToolDef linking a spec to a callable.
Sourcepub fn with_prerequisites(self, prereqs: Vec<PrerequisiteSpec>) -> Self
pub fn with_prerequisites(self, prereqs: Vec<PrerequisiteSpec>) -> Self
Appends prerequisites to the tool definition.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ToolDef
impl !UnwindSafe for ToolDef
impl Freeze for ToolDef
impl Send for ToolDef
impl Sync for ToolDef
impl Unpin for ToolDef
impl UnsafeUnpin for ToolDef
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.