pub struct Toggle {
pub common: Common,
pub label: Line,
pub value: bool,
pub disabled: Option<bool>,
pub on_change: Option<ActionId>,
}Expand description
A boolean switch (§4.5.2).
Fields§
§common: CommonCommon node props (key is required for Toggle).
label: LineSwitch label.
value: boolCurrent value (wins when it changes, §4.6).
disabled: Option<bool>Greyed out.
on_change: Option<ActionId>Action on change (the new bool).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Toggle
impl<'de> Deserialize<'de> for Toggle
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
impl StructuralPartialEq for Toggle
Source§impl WithCommon for Toggle
impl WithCommon for Toggle
Source§fn common_mut(&mut self) -> &mut Common
fn common_mut(&mut self) -> &mut Common
Mutable access to the node’s common props.
Source§fn block(self, block: impl Into<BlockProps>) -> Self
fn block(self, block: impl Into<BlockProps>) -> Self
Sets the surrounding block.
Auto Trait Implementations§
impl Freeze for Toggle
impl RefUnwindSafe for Toggle
impl Send for Toggle
impl Sync for Toggle
impl Unpin for Toggle
impl UnsafeUnpin for Toggle
impl UnwindSafe for Toggle
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