pub struct FnTool<F, Fut>where
F: Fn(Value) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Value, ToolError>> + Send + 'static,{ /* private fields */ }Available on crate feature
async only.Expand description
Internal adapter: wraps a closure and exposes it through the Tool
trait. Created by ToolRegistry::register and
ToolRegistry::register_described.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<F, Fut> Freeze for FnTool<F, Fut>where
F: Freeze,
impl<F, Fut> RefUnwindSafe for FnTool<F, Fut>where
F: RefUnwindSafe,
impl<F, Fut> Send for FnTool<F, Fut>
impl<F, Fut> Sync for FnTool<F, Fut>
impl<F, Fut> Unpin for FnTool<F, Fut>where
F: Unpin,
impl<F, Fut> UnsafeUnpin for FnTool<F, Fut>where
F: UnsafeUnpin,
impl<F, Fut> UnwindSafe for FnTool<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
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.