pub struct ParamDecl {
pub name: String,
pub param_type: Option<String>,
pub description: Option<String>,
pub required: bool,
pub default: Option<Value>,
pub max_length: Option<u64>,
pub minimum: Option<f64>,
pub maximum: Option<f64>,
pub enum_values: Option<Vec<Value>>,
}Expand description
Single [[tools.parameters]] entry.
The default and enum fields use toml::Value because they are
heterogeneous in the reference configs (a default may be an integer,
a string, or a boolean depending on the parameter type).
Fields§
§name: StringParameter name (the :param token used in the tool’s sql).
param_type: Option<String>JSON-schema type ("string", "integer", "number", "boolean").
description: Option<String>Human-readable parameter description.
required: boolWhether the parameter is required.
default: Option<Value>Optional default value (any TOML type).
max_length: Option<u64>Maximum string length (string parameters only).
minimum: Option<f64>Inclusive minimum (integer / number parameters only).
maximum: Option<f64>Inclusive maximum (integer / number parameters only).
enum_values: Option<Vec<Value>>Closed set of allowed values (any TOML scalar).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ParamDecl
impl<'de> Deserialize<'de> for ParamDecl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ParamDecl
Auto Trait Implementations§
impl Freeze for ParamDecl
impl RefUnwindSafe for ParamDecl
impl Send for ParamDecl
impl Sync for ParamDecl
impl Unpin for ParamDecl
impl UnsafeUnpin for ParamDecl
impl UnwindSafe for ParamDecl
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.