pub struct ElicitFormSchema {
pub schema_type: String,
pub properties: HashMap<String, PrimitiveSchemaDefinition>,
pub required: Vec<String>,
}Expand description
Restricted JSON Schema for elicitation forms
Only allows top-level properties with primitive types.
Fields§
§schema_type: StringMust be “object”
properties: HashMap<String, PrimitiveSchemaDefinition>Map of property names to their schema definitions
required: Vec<String>List of required property names
Implementations§
Source§impl ElicitFormSchema
impl ElicitFormSchema
Sourcepub fn string_field(
self,
name: &str,
description: Option<&str>,
required: bool,
) -> Self
pub fn string_field( self, name: &str, description: Option<&str>, required: bool, ) -> Self
Add a string field
Sourcepub fn string_field_with_default(
self,
name: &str,
description: Option<&str>,
required: bool,
default: &str,
) -> Self
pub fn string_field_with_default( self, name: &str, description: Option<&str>, required: bool, default: &str, ) -> Self
Add a string field with a default value
Sourcepub fn integer_field(
self,
name: &str,
description: Option<&str>,
required: bool,
) -> Self
pub fn integer_field( self, name: &str, description: Option<&str>, required: bool, ) -> Self
Add an integer field
Sourcepub fn integer_field_with_default(
self,
name: &str,
description: Option<&str>,
required: bool,
default: i64,
) -> Self
pub fn integer_field_with_default( self, name: &str, description: Option<&str>, required: bool, default: i64, ) -> Self
Add an integer field with a default value
Sourcepub fn number_field(
self,
name: &str,
description: Option<&str>,
required: bool,
) -> Self
pub fn number_field( self, name: &str, description: Option<&str>, required: bool, ) -> Self
Add a number field
Sourcepub fn number_field_with_default(
self,
name: &str,
description: Option<&str>,
required: bool,
default: f64,
) -> Self
pub fn number_field_with_default( self, name: &str, description: Option<&str>, required: bool, default: f64, ) -> Self
Add a number field with a default value
Sourcepub fn boolean_field(
self,
name: &str,
description: Option<&str>,
required: bool,
) -> Self
pub fn boolean_field( self, name: &str, description: Option<&str>, required: bool, ) -> Self
Add a boolean field
Sourcepub fn boolean_field_with_default(
self,
name: &str,
description: Option<&str>,
required: bool,
default: bool,
) -> Self
pub fn boolean_field_with_default( self, name: &str, description: Option<&str>, required: bool, default: bool, ) -> Self
Add a boolean field with a default value
Sourcepub fn enum_field(
self,
name: &str,
description: Option<&str>,
options: Vec<String>,
required: bool,
) -> Self
pub fn enum_field( self, name: &str, description: Option<&str>, options: Vec<String>, required: bool, ) -> Self
Add a single-select enum field
Trait Implementations§
Source§impl Clone for ElicitFormSchema
impl Clone for ElicitFormSchema
Source§fn clone(&self) -> ElicitFormSchema
fn clone(&self) -> ElicitFormSchema
Returns a duplicate 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 moreSource§impl Debug for ElicitFormSchema
impl Debug for ElicitFormSchema
Source§impl Default for ElicitFormSchema
impl Default for ElicitFormSchema
Source§impl<'de> Deserialize<'de> for ElicitFormSchema
impl<'de> Deserialize<'de> for ElicitFormSchema
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
Auto Trait Implementations§
impl Freeze for ElicitFormSchema
impl RefUnwindSafe for ElicitFormSchema
impl Send for ElicitFormSchema
impl Sync for ElicitFormSchema
impl Unpin for ElicitFormSchema
impl UnwindSafe for ElicitFormSchema
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