pub enum KnobKind {
Show 14 variants
Bool {
default: bool,
},
OptBool {
default: Option<bool>,
},
I32 {
default: i32,
min: i32,
max: i32,
step: i32,
},
OptI32 {
default: Option<i32>,
min: i32,
max: i32,
step: i32,
},
F32 {
default: f32,
min: f32,
max: f32,
step: f32,
},
OptF32 {
default: Option<f32>,
min: f32,
max: f32,
step: f32,
},
Text {
default: String,
},
OptText {
default: Option<String>,
},
Choice {
options: Vec<&'static str>,
default: usize,
},
Enum {
enum_path: &'static str,
variants: Vec<&'static str>,
default: usize,
},
TextRole {
default: TextRole,
},
SurfaceRole {
default: SurfaceRole,
},
BorderRole {
default: BorderRole,
},
TextStyle {
default: TextStyleRole,
},
}Expand description
A typed knob declaration. Each kind maps 1:1 to a Signal<T> in
KnobValues and to one row in the inspector’s auto-generated form.
Variants§
Bool
OptBool
I32
OptI32
F32
OptF32
Text
OptText
Choice
Position-based selection over a fixed list of labels.
Enum
A Rust enum property: like Choice, but carries the enum’s path and
variant idents so a design tool can render a dropdown and emit
enum_path::variant. Stored at runtime as a usize index (like Choice).
TextRole
SurfaceRole
Fields
§
default: SurfaceRoleBorderRole
Fields
§
default: BorderRoleTextStyle
Fields
§
default: TextStyleRoleImplementations§
Source§impl KnobKind
impl KnobKind
Sourcepub fn enum_info(&self) -> Option<EnumInfo>
pub fn enum_info(&self) -> Option<EnumInfo>
For enum-typed knobs (Enum and the four role kinds), the data needed to
render a dropdown + emit Path::Variant; None for scalar / text /
label-only Choice kinds. The role variant lists come from
teksilo_tokens, so they never drift from the actual enums.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KnobKind
impl RefUnwindSafe for KnobKind
impl Send for KnobKind
impl Sync for KnobKind
impl Unpin for KnobKind
impl UnsafeUnpin for KnobKind
impl UnwindSafe for KnobKind
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