pub struct TitledSingleSelectEnumSchema {
pub default: Option<String>,
pub description: Option<String>,
pub one_of: Vec<TitledSingleSelectEnumSchemaOneOfItem>,
pub title: Option<String>,
/* private fields */
}Expand description
Schema for single-selection enumeration with display titles for each option.
JSON schema
{
"description": "Schema for single-selection enumeration with display titles for each option.",
"type": "object",
"required": [
"oneOf",
"type"
],
"properties": {
"default": {
"description": "Optional default value.",
"type": "string"
},
"description": {
"description": "Optional description for the enum field.",
"type": "string"
},
"oneOf": {
"description": "Array of enum options with values and display labels.",
"type": "array",
"items": {
"type": "object",
"required": [
"const",
"title"
],
"properties": {
"const": {
"description": "The enum value.",
"type": "string"
},
"title": {
"description": "Display label for this option.",
"type": "string"
}
}
}
},
"title": {
"description": "Optional title for the enum field.",
"type": "string"
},
"type": {
"type": "string",
"const": "string"
}
}
}Fields§
§default: Option<String>Optional default value.
description: Option<String>Optional description for the enum field.
one_of: Vec<TitledSingleSelectEnumSchemaOneOfItem>Array of enum options with values and display labels.
title: Option<String>Optional title for the enum field.
Implementations§
Source§impl TitledSingleSelectEnumSchema
impl TitledSingleSelectEnumSchema
pub fn new( one_of: Vec<TitledSingleSelectEnumSchemaOneOfItem>, default: Option<String>, description: Option<String>, title: Option<String>, ) -> Self
pub fn type_(&self) -> &String
Sourcepub fn type_value() -> String
pub fn type_value() -> String
returns “string”
pub fn type_name() -> String
👎Deprecated since 0.8.0: Use
type_value() instead.Trait Implementations§
Source§impl Clone for TitledSingleSelectEnumSchema
impl Clone for TitledSingleSelectEnumSchema
Source§fn clone(&self) -> TitledSingleSelectEnumSchema
fn clone(&self) -> TitledSingleSelectEnumSchema
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 TitledSingleSelectEnumSchema
impl Debug for TitledSingleSelectEnumSchema
Source§impl<'de> Deserialize<'de> for TitledSingleSelectEnumSchema
impl<'de> Deserialize<'de> for TitledSingleSelectEnumSchema
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 From<TitledSingleSelectEnumSchema> for EnumSchema
impl From<TitledSingleSelectEnumSchema> for EnumSchema
Source§fn from(value: TitledSingleSelectEnumSchema) -> Self
fn from(value: TitledSingleSelectEnumSchema) -> Self
Converts to this type from the input type.
Source§impl From<TitledSingleSelectEnumSchema> for PrimitiveSchemaDefinition
impl From<TitledSingleSelectEnumSchema> for PrimitiveSchemaDefinition
Source§fn from(value: TitledSingleSelectEnumSchema) -> Self
fn from(value: TitledSingleSelectEnumSchema) -> Self
Converts to this type from the input type.
Source§impl From<TitledSingleSelectEnumSchema> for SingleSelectEnumSchema
impl From<TitledSingleSelectEnumSchema> for SingleSelectEnumSchema
Source§fn from(value: TitledSingleSelectEnumSchema) -> Self
fn from(value: TitledSingleSelectEnumSchema) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TitledSingleSelectEnumSchema
impl RefUnwindSafe for TitledSingleSelectEnumSchema
impl Send for TitledSingleSelectEnumSchema
impl Sync for TitledSingleSelectEnumSchema
impl Unpin for TitledSingleSelectEnumSchema
impl UnwindSafe for TitledSingleSelectEnumSchema
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