pub struct AsyncToolHandler<F, Fut>where
F: Fn(ToolCall) -> Fut + Send + Sync,
Fut: Future<Output = Result<Value, RealtimeError>> + Send,{ /* private fields */ }Available on crate feature
realtime only.Expand description
Async function-based tool handler.
Implementations§
Source§impl<F, Fut> AsyncToolHandler<F, Fut>
impl<F, Fut> AsyncToolHandler<F, Fut>
Sourcepub fn new(handler: F) -> AsyncToolHandler<F, Fut>
pub fn new(handler: F) -> AsyncToolHandler<F, Fut>
Create a new async tool handler.
Auto Trait Implementations§
impl<F, Fut> Freeze for AsyncToolHandler<F, Fut>where
F: Freeze,
impl<F, Fut> RefUnwindSafe for AsyncToolHandler<F, Fut>where
F: RefUnwindSafe,
impl<F, Fut> Send for AsyncToolHandler<F, Fut>
impl<F, Fut> Sync for AsyncToolHandler<F, Fut>
impl<F, Fut> Unpin for AsyncToolHandler<F, Fut>where
F: Unpin,
impl<F, Fut> UnsafeUnpin for AsyncToolHandler<F, Fut>where
F: UnsafeUnpin,
impl<F, Fut> UnwindSafe for AsyncToolHandler<F, Fut>where
F: UnwindSafe,
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