pub struct LabelToggle<'a> { /* private fields */ }Expand description
A toggle widget that behaves like a label but can be toggled on/off.
Implementations§
Source§impl<'a> LabelToggle<'a>
impl<'a> LabelToggle<'a>
Sourcepub fn new(text: impl Into<WidgetText>, selected: &'a mut bool) -> Self
pub fn new(text: impl Into<WidgetText>, selected: &'a mut bool) -> Self
Create a new LabelToggle from raw text
Sourcepub fn from_label(label: Label, selected: &'a mut bool) -> Self
pub fn from_label(label: Label, selected: &'a mut bool) -> Self
Create a LabelToggle from an existing Label This allows using all Label options like wrap(), truncate(), etc.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for LabelToggle<'a>
impl<'a> RefUnwindSafe for LabelToggle<'a>
impl<'a> Send for LabelToggle<'a>
impl<'a> Sync for LabelToggle<'a>
impl<'a> Unpin for LabelToggle<'a>
impl<'a> !UnwindSafe for LabelToggle<'a>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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