pub struct Switch<'a> { /* private fields */ }Expand description
An on/off switch: a track (the kit’s switch component, selected
while on) and a round thumb, at the track’s start while off and at its
end while on, in the state’s text; its label after it, in the text
of the same state off. Laid out as a checkbox is (egui’s interaction
height, the box’s side as the track’s height), clicked, or pressed
with Space or Enter when focused, to toggle. A switch to assistive
technology (AccessKit’s Switch role, toggled while on), named by its
label or by Switch::name. The thumb moves at once: no animation to
wait for, none to turn off for reduced motion.
For a setting that takes effect at once (a feature on or off); a
choice confirmed later is a Checkbox.
Need (input): an on/off switch (a toggle with a track and a thumb).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Switch<'a>
impl<'a> !RefUnwindSafe for Switch<'a>
impl<'a> !Send for Switch<'a>
impl<'a> !Sync for Switch<'a>
impl<'a> Unpin for Switch<'a>
impl<'a> UnsafeUnpin for Switch<'a>
impl<'a> !UnwindSafe for Switch<'a>
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
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>
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>
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