#[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

Fields

§default_set: bool
§content: Box<SchemaNode>
§

Switch

Fields

§default_enabled: bool
§content: Box<SchemaNode>
§

Boolean

Fields

§default: bool
§

Integer

Fields

§default: i128
§step: Option<i128>
§

Float

Fields

§default: f64
§step: Option<f64>
§

Text

Fields

§default: String
§

Array(Vec<SchemaNode>)

§

Vector

Fields

§default_element: Box<SchemaNode>
§default: Value
§

Dictionary

Fields

§default_key: String
§default_value: Box<SchemaNode>
§default: Value

Trait Implementations§

source§

impl Clone for SchemaNode

source§

fn clone(&self) -> SchemaNode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SchemaNode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SchemaNode

source§

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 Serialize for SchemaNode

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
__S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere
T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,