#[non_exhaustive]pub struct ElicitationSchema {
pub type_: ElicitationSchemaType,
pub title: Option<String>,
pub properties: BTreeMap<String, ElicitationPropertySchema>,
pub required: Option<Vec<String>>,
pub description: Option<String>,
}Available on crate feature
unstable_elicitation only.Expand description
Type-safe elicitation schema for requesting structured user input.
This represents a JSON Schema object with primitive-typed properties, as required by the elicitation specification.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.type_: ElicitationSchemaTypeType discriminator. Always "object".
title: Option<String>Optional title for the schema.
properties: BTreeMap<String, ElicitationPropertySchema>Property definitions (must be primitive types).
required: Option<Vec<String>>List of required property names.
description: Option<String>Optional description of what this schema represents.
Implementations§
Source§impl ElicitationSchema
impl ElicitationSchema
Sourcepub fn title(self, title: impl IntoOption<String>) -> Self
pub fn title(self, title: impl IntoOption<String>) -> Self
Optional title for the schema.
Sourcepub fn description(self, description: impl IntoOption<String>) -> Self
pub fn description(self, description: impl IntoOption<String>) -> Self
Optional description of what this schema represents.
Sourcepub fn property<S>(
self,
name: impl Into<String>,
schema: S,
required: bool,
) -> Selfwhere
S: Into<ElicitationPropertySchema>,
pub fn property<S>(
self,
name: impl Into<String>,
schema: S,
required: bool,
) -> Selfwhere
S: Into<ElicitationPropertySchema>,
Add a property to the schema.
Sourcepub fn date_time(self, name: impl Into<String>, required: bool) -> Self
pub fn date_time(self, name: impl Into<String>, required: bool) -> Self
Add a date-time property.
Sourcepub fn number(
self,
name: impl Into<String>,
min: f64,
max: f64,
required: bool,
) -> Self
pub fn number( self, name: impl Into<String>, min: f64, max: f64, required: bool, ) -> Self
Add a number property with range.
Trait Implementations§
Source§impl Clone for ElicitationSchema
impl Clone for ElicitationSchema
Source§fn clone(&self) -> ElicitationSchema
fn clone(&self) -> ElicitationSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ElicitationSchema
impl Debug for ElicitationSchema
Source§impl Default for ElicitationSchema
impl Default for ElicitationSchema
Source§impl<'de> Deserialize<'de> for ElicitationSchema
impl<'de> Deserialize<'de> for ElicitationSchema
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
Source§impl IntoV2 for ElicitationSchema
Available on crate feature unstable_protocol_v2 only.
impl IntoV2 for ElicitationSchema
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonSchema for ElicitationSchema
impl JsonSchema for ElicitationSchema
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ElicitationSchema
impl PartialEq for ElicitationSchema
Source§fn eq(&self, other: &ElicitationSchema) -> bool
fn eq(&self, other: &ElicitationSchema) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ElicitationSchema
impl Serialize for ElicitationSchema
impl StructuralPartialEq for ElicitationSchema
Auto Trait Implementations§
impl Freeze for ElicitationSchema
impl RefUnwindSafe for ElicitationSchema
impl Send for ElicitationSchema
impl Sync for ElicitationSchema
impl Unpin for ElicitationSchema
impl UnsafeUnpin for ElicitationSchema
impl UnwindSafe for ElicitationSchema
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