Enum settings_schema::SchemaNode
source · #[non_exhaustive]
pub enum SchemaNode {
Section(Vec<NamedEntry<SchemaNode>>),
Choice {
default: String,
variants: Vec<NamedEntry<Option<SchemaNode>>>,
gui: Option<ChoiceControlType>,
},
Optional {
default_set: bool,
content: Box<SchemaNode>,
},
Switch {
default_enabled: bool,
content: Box<SchemaNode>,
},
Boolean {
default: bool,
},
Integer {
default: i128,
min: Option<i128>,
max: Option<i128>,
step: Option<i128>,
gui: Option<NumericGuiType>,
},
Float {
default: f64,
min: Option<f64>,
max: Option<f64>,
step: Option<f64>,
gui: Option<NumericGuiType>,
},
Text {
default: String,
},
Array(Vec<SchemaNode>),
Vector {
default_element: Box<SchemaNode>,
default: Value,
},
Dictionary {
default_key: String,
default_value: Box<SchemaNode>,
default: Value,
},
}Expand description
Schema base type returned by <YourStructOrEnum>::schema(), generated by the macro
#[derive(SettingsSchema)]. It can be used as is (for Rust based GUIs) or it can be serialized
to JSON for creating GUIs in other languages.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Section(Vec<NamedEntry<SchemaNode>>)
Choice
Optional
Switch
Boolean
Integer
Fields
§
gui: Option<NumericGuiType>Float
Text
Array(Vec<SchemaNode>)
Vector
Dictionary
Trait Implementations§
source§impl Clone for SchemaNode
impl Clone for SchemaNode
source§fn clone(&self) -> SchemaNode
fn clone(&self) -> SchemaNode
Returns a copy 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 SchemaNode
impl Debug for SchemaNode
source§impl<'de> Deserialize<'de> for SchemaNode
impl<'de> Deserialize<'de> for SchemaNode
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