#[repr(C)]pub struct Switch {
pub switch_state: SwitchStateWrapper,
pub track_style: CssPropertyWithConditionsVec,
pub knob_style: CssPropertyWithConditionsVec,
}Expand description
A toggleable on/off switch widget with a sliding knob and toggle callback.
Fields§
§switch_state: SwitchStateWrapper§track_style: CssPropertyWithConditionsVecStyle for the switch track (the pill-shaped container)
knob_style: CssPropertyWithConditionsVecStyle for the sliding knob
Implementations§
Source§impl Switch
impl Switch
Sourcepub fn create(checked: bool) -> Self
pub fn create(checked: bool) -> Self
Creates a new switch in the given on/off state with default styling.
pub fn swap_with_default(&mut self) -> Self
pub fn set_on_toggle<C: Into<SwitchOnToggleCallback>>( &mut self, data: RefAny, on_toggle: C, )
pub fn with_on_toggle<C: Into<SwitchOnToggleCallback>>( self, data: RefAny, on_toggle: C, ) -> Self
pub fn dom(self) -> Dom
Trait Implementations§
impl Eq for Switch
impl StructuralPartialEq for Switch
Auto Trait Implementations§
impl Freeze for Switch
impl RefUnwindSafe for Switch
impl Send for Switch
impl Sync for Switch
impl Unpin for Switch
impl UnsafeUnpin for Switch
impl UnwindSafe for Switch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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