pub struct ToolCollection { /* private fields */ }Implementations§
Source§impl ToolCollection
impl ToolCollection
pub fn new() -> ToolCollection
pub fn register<I, O, F, Fut>(
&mut self,
name: &'static str,
desc: &'static str,
func: F,
) -> Result<&mut ToolCollection, ToolError>where
I: 'static + DeserializeOwned + Serialize + Send + ToolSchema,
O: 'static + Serialize + Send + ToolSchema,
F: Fn(I) -> Fut + Send + Sync + 'static,
Fut: Future<Output = O> + Send + 'static,
pub async fn call( &self, call: FunctionCall, ) -> Result<FunctionResponse, ToolError>
pub fn unregister(&mut self, name: &str) -> Result<(), ToolError>
pub fn descriptions(&self) -> impl Iterator<Item = (&'static str, &'static str)>
pub fn collect_tools() -> ToolCollection
pub fn json(&self) -> Result<Value, ToolError>
Trait Implementations§
Source§impl Clone for ToolCollection
impl Clone for ToolCollection
Source§fn clone(&self) -> ToolCollection
fn clone(&self) -> ToolCollection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for ToolCollection
impl Default for ToolCollection
Source§fn default() -> ToolCollection
fn default() -> ToolCollection
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToolCollection
impl !RefUnwindSafe for ToolCollection
impl Send for ToolCollection
impl Sync for ToolCollection
impl Unpin for ToolCollection
impl UnsafeUnpin for ToolCollection
impl !UnwindSafe for ToolCollection
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