pub struct LegacyTitledEnumSchema {
pub default: Option<String>,
pub description: Option<String>,
pub enum_: Vec<String>,
pub enum_names: Vec<String>,
pub title: Option<String>,
/* private fields */
}Expand description
Use TitledSingleSelectEnumSchema instead. This interface will be removed in a future version.
JSON schema
{
"description": "Use TitledSingleSelectEnumSchema instead.\nThis interface will be removed in a future version.",
"type": "object",
"required": [
"enum",
"type"
],
"properties": {
"default": {
"type": "string"
},
"description": {
"type": "string"
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
},
"enumNames": {
"description": "(Legacy) Display names for enum values.\nNon-standard according to JSON schema 2020-12.",
"type": "array",
"items": {
"type": "string"
}
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"const": "string"
}
}
}Fields§
§default: Option<String>§description: Option<String>§enum_: Vec<String>§enum_names: Vec<String>(Legacy) Display names for enum values. Non-standard according to JSON schema 2020-12.
title: Option<String>Implementations§
Source§impl LegacyTitledEnumSchema
impl LegacyTitledEnumSchema
pub fn new( enum_: Vec<String>, enum_names: Vec<String>, 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 LegacyTitledEnumSchema
impl Clone for LegacyTitledEnumSchema
Source§fn clone(&self) -> LegacyTitledEnumSchema
fn clone(&self) -> LegacyTitledEnumSchema
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 LegacyTitledEnumSchema
impl Debug for LegacyTitledEnumSchema
Source§impl<'de> Deserialize<'de> for LegacyTitledEnumSchema
impl<'de> Deserialize<'de> for LegacyTitledEnumSchema
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<LegacyTitledEnumSchema> for EnumSchema
impl From<LegacyTitledEnumSchema> for EnumSchema
Source§fn from(value: LegacyTitledEnumSchema) -> Self
fn from(value: LegacyTitledEnumSchema) -> Self
Converts to this type from the input type.
Source§impl From<LegacyTitledEnumSchema> for PrimitiveSchemaDefinition
impl From<LegacyTitledEnumSchema> for PrimitiveSchemaDefinition
Source§fn from(value: LegacyTitledEnumSchema) -> Self
fn from(value: LegacyTitledEnumSchema) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for LegacyTitledEnumSchema
impl RefUnwindSafe for LegacyTitledEnumSchema
impl Send for LegacyTitledEnumSchema
impl Sync for LegacyTitledEnumSchema
impl Unpin for LegacyTitledEnumSchema
impl UnwindSafe for LegacyTitledEnumSchema
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