pub struct ToolBuilder { /* private fields */ }Expand description
Fluent builder for tools
Implementations§
Source§impl ToolBuilder
impl ToolBuilder
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Set description
Sourcepub fn parameter(
self,
name: impl Into<String>,
param_type: impl Into<String>,
description: impl Into<String>,
required: bool,
) -> Self
pub fn parameter( self, name: impl Into<String>, param_type: impl Into<String>, description: impl Into<String>, required: bool, ) -> Self
Add a parameter
Sourcepub fn string_param(
self,
name: impl Into<String>,
description: impl Into<String>,
required: bool,
) -> Self
pub fn string_param( self, name: impl Into<String>, description: impl Into<String>, required: bool, ) -> Self
Add a string parameter
Sourcepub fn number_param(
self,
name: impl Into<String>,
description: impl Into<String>,
required: bool,
) -> Self
pub fn number_param( self, name: impl Into<String>, description: impl Into<String>, required: bool, ) -> Self
Add a number parameter
Sourcepub fn bool_param(
self,
name: impl Into<String>,
description: impl Into<String>,
required: bool,
) -> Self
pub fn bool_param( self, name: impl Into<String>, description: impl Into<String>, required: bool, ) -> Self
Add a boolean parameter
Sourcepub fn category(self, category: ToolCategory) -> Self
pub fn category(self, category: ToolCategory) -> Self
Set category
Sourcepub fn requires_confirmation(self, requires: bool) -> Self
pub fn requires_confirmation(self, requires: bool) -> Self
Set requires confirmation
Auto Trait Implementations§
impl Freeze for ToolBuilder
impl RefUnwindSafe for ToolBuilder
impl Send for ToolBuilder
impl Sync for ToolBuilder
impl Unpin for ToolBuilder
impl UnwindSafe for ToolBuilder
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 more