#[non_exhaustive]pub struct StringPropertySchema {
pub title: Option<String>,
pub description: Option<String>,
pub min_length: Option<u32>,
pub max_length: Option<u32>,
pub pattern: Option<String>,
pub format: Option<StringFormat>,
pub default: Option<String>,
pub enum_values: Option<Vec<String>>,
pub one_of: Option<Vec<EnumOption>>,
pub meta: Option<Meta>,
}unstable_elicitation only.Expand description
Schema for string properties in an elicitation form.
When enum or oneOf is set, this represents a single-select enum
with "type": "string".
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.title: Option<String>Optional title for the property.
description: Option<String>Human-readable description.
min_length: Option<u32>Minimum string length.
max_length: Option<u32>Maximum string length.
pattern: Option<String>Pattern the string must match.
format: Option<StringFormat>String format.
default: Option<String>Default value.
enum_values: Option<Vec<String>>Enum values for untitled single-select enums.
one_of: Option<Vec<EnumOption>>Titled enum options for titled single-select enums.
meta: Option<Meta>The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl StringPropertySchema
impl StringPropertySchema
Sourcepub fn title(self, title: impl IntoOption<String>) -> Self
pub fn title(self, title: impl IntoOption<String>) -> Self
Optional title for the property.
Sourcepub fn description(self, description: impl IntoOption<String>) -> Self
pub fn description(self, description: impl IntoOption<String>) -> Self
Human-readable description.
Sourcepub fn min_length(self, min_length: impl IntoOption<u32>) -> Self
pub fn min_length(self, min_length: impl IntoOption<u32>) -> Self
Minimum string length.
Sourcepub fn max_length(self, max_length: impl IntoOption<u32>) -> Self
pub fn max_length(self, max_length: impl IntoOption<u32>) -> Self
Maximum string length.
Sourcepub fn pattern(self, pattern: impl IntoOption<String>) -> Self
pub fn pattern(self, pattern: impl IntoOption<String>) -> Self
Pattern the string must match.
Sourcepub fn format(self, format: impl IntoOption<StringFormat>) -> Self
pub fn format(self, format: impl IntoOption<StringFormat>) -> Self
String format.
Sourcepub fn default_value(self, default: impl IntoOption<String>) -> Self
pub fn default_value(self, default: impl IntoOption<String>) -> Self
Default value.
Sourcepub fn enum_values(self, enum_values: impl IntoOption<Vec<String>>) -> Self
pub fn enum_values(self, enum_values: impl IntoOption<Vec<String>>) -> Self
Enum values for untitled single-select enums.
Sourcepub fn one_of(self, one_of: impl IntoOption<Vec<EnumOption>>) -> Self
pub fn one_of(self, one_of: impl IntoOption<Vec<EnumOption>>) -> Self
Titled enum options for titled single-select enums.
Sourcepub fn meta(self, meta: impl IntoOption<Meta>) -> Self
pub fn meta(self, meta: impl IntoOption<Meta>) -> Self
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Trait Implementations§
Source§impl Clone for StringPropertySchema
impl Clone for StringPropertySchema
Source§fn clone(&self) -> StringPropertySchema
fn clone(&self) -> StringPropertySchema
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StringPropertySchema
impl Debug for StringPropertySchema
Source§impl Default for StringPropertySchema
impl Default for StringPropertySchema
Source§fn default() -> StringPropertySchema
fn default() -> StringPropertySchema
Source§impl<'de> Deserialize<'de> for StringPropertySchema
impl<'de> Deserialize<'de> for StringPropertySchema
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>,
Source§impl From<StringPropertySchema> for ElicitationPropertySchema
impl From<StringPropertySchema> for ElicitationPropertySchema
Source§fn from(schema: StringPropertySchema) -> Self
fn from(schema: StringPropertySchema) -> Self
Source§impl IntoV2 for StringPropertySchema
Available on crate feature unstable_protocol_v2 only.
impl IntoV2 for StringPropertySchema
unstable_protocol_v2 only.Source§impl JsonSchema for StringPropertySchema
impl JsonSchema for StringPropertySchema
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for StringPropertySchema
impl PartialEq for StringPropertySchema
Source§fn eq(&self, other: &StringPropertySchema) -> bool
fn eq(&self, other: &StringPropertySchema) -> bool
self and other values to be equal, and is used by ==.