#[non_exhaustive]pub enum WidgetSpec {
Show 17 variants
Label {
text: String,
size: f32,
tone: String,
strong: bool,
},
Button {
id: String,
label: String,
variant: String,
enabled: bool,
},
TextField {
id: String,
label: String,
value: String,
hint: String,
},
Checkbox {
id: String,
label: String,
checked: bool,
},
Switch {
id: String,
label: String,
on: bool,
},
Select {
id: String,
label: String,
options: Vec<String>,
selected: usize,
},
Slider {
id: String,
label: String,
min: f64,
max: f64,
value: f64,
step: f64,
},
Separator,
Spacer {
height: f32,
},
Row {
children: Vec<WidgetSpec>,
gap: f32,
},
Column {
children: Vec<WidgetSpec>,
gap: f32,
},
Card {
title: String,
children: Vec<WidgetSpec>,
},
Tabs {
id: String,
tabs: Vec<String>,
active: usize,
children: Vec<Vec<WidgetSpec>>,
},
Tree {
id: String,
nodes: Vec<TreeSpec>,
selected: Option<String>,
},
DataGrid {
id: String,
dataset: String,
height: f32,
},
Plot {
id: String,
title: String,
series: Vec<SeriesSpec>,
height: f32,
renderer: String,
},
Custom {
widget: String,
props: Value,
},
}Available on crate feature
spec only.Expand description
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.
Label
A label.
Fields
Button
A button that emits its command id.
Fields
TextField
A single-line text input.
Checkbox
A checkbox.
Switch
A switch.
Select
A select.
Fields
Slider
A slider.
Fields
Separator
A horizontal rule.
Spacer
Empty space.
Row
A horizontal row.
Column
A vertical column.
Card
A titled card.
Tabs
A tab strip and its active content.
Fields
§
children: Vec<Vec<WidgetSpec>>Content per tab.
Tree
An explorer-style tree.
DataGrid
A typed data grid over a host dataset.
Fields
Plot
A plot over points or a host dataset.
Fields
§
series: Vec<SeriesSpec>Series.
Custom
A Rust extension widget registered with Host::register_custom.
Trait Implementations§
Source§impl Clone for WidgetSpec
impl Clone for WidgetSpec
Source§impl Debug for WidgetSpec
impl Debug for WidgetSpec
Source§impl<'de> Deserialize<'de> for WidgetSpec
impl<'de> Deserialize<'de> for WidgetSpec
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 JsonSchema for WidgetSpec
impl JsonSchema for WidgetSpec
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Forget for WidgetSpec
impl Freeze for WidgetSpecwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<WidgetSpec>: Freeze,
PhantomData<Vec<WidgetSpec>>: Freeze,
PhantomData<TreeSpec>: Freeze,
PhantomData<SeriesSpec>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for WidgetSpec
impl RefUnwindSafe for WidgetSpec
impl Send for WidgetSpec
impl Sync for WidgetSpec
impl Unpin for WidgetSpec
impl UnsafeUnpin for WidgetSpecwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<WidgetSpec>: UnsafeUnpin,
PhantomData<Vec<WidgetSpec>>: UnsafeUnpin,
PhantomData<TreeSpec>: UnsafeUnpin,
PhantomData<SeriesSpec>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for WidgetSpec
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more