pub struct ParameterBuilder { /* private fields */ }
Expand description
Builder for creating a parameter for a function tool.
Implementations§
Source§impl ParameterBuilder
impl ParameterBuilder
Sourcepub fn new<S: Into<String>>(name: S, type_: ParameterType) -> Self
pub fn new<S: Into<String>>(name: S, type_: ParameterType) -> Self
Create a new parameter builder with a name and type.
Sourcepub fn with_description<S: Into<String>>(self, description: S) -> Self
pub fn with_description<S: Into<String>>(self, description: S) -> Self
Add a description to the parameter.
Sourcepub fn is_required(self) -> Self
pub fn is_required(self) -> Self
Mark the parameter as required.
Sourcepub fn with_enum_values<S: Into<String>, I: IntoIterator<Item = S>>(
self,
values: I,
) -> Self
pub fn with_enum_values<S: Into<String>, I: IntoIterator<Item = S>>( self, values: I, ) -> Self
Add allowed enum values for the parameter.
Trait Implementations§
Source§impl Clone for ParameterBuilder
impl Clone for ParameterBuilder
Source§fn clone(&self) -> ParameterBuilder
fn clone(&self) -> ParameterBuilder
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for ParameterBuilder
impl RefUnwindSafe for ParameterBuilder
impl Send for ParameterBuilder
impl Sync for ParameterBuilder
impl Unpin for ParameterBuilder
impl UnwindSafe for ParameterBuilder
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