pub struct EuvToggleProps {
pub pressed: Signal<bool>,
pub variant: EuvToggleVariant,
pub size: EuvToggleSize,
pub label: &'static str,
pub disabled: Signal<bool>,
pub on_change: Option<Rc<dyn Fn(bool)>>,
}Expand description
Props for the euv_toggle component.
The pressed state lives in a caller-owned Signal<bool> so the control
takes part in two-way binding with the rest of the page.
Fields§
§pressed: Signal<bool>The signal holding the pressed state.
variant: EuvToggleVariantThe visual variant.
size: EuvToggleSizeThe control size.
label: &'static strThe label shown inside the control.
disabled: Signal<bool>Whether the control is disabled.
on_change: Option<Rc<dyn Fn(bool)>>Optional callback receiving the new pressed state.
Implementations§
Source§impl EuvToggleProps
impl EuvToggleProps
pub fn get_pressed(&self) -> Signal<bool>
pub fn get_mut_pressed(&mut self) -> &mut Signal<bool>
pub fn set_pressed(&mut self, val: Signal<bool>) -> &mut Self
pub fn get_variant(&self) -> EuvToggleVariant
pub fn get_mut_variant(&mut self) -> &mut EuvToggleVariant
pub fn set_variant(&mut self, val: EuvToggleVariant) -> &mut Self
pub fn get_size(&self) -> EuvToggleSize
pub fn get_mut_size(&mut self) -> &mut EuvToggleSize
pub fn set_size(&mut self, val: EuvToggleSize) -> &mut Self
pub fn get_label(&self) -> &'static str
pub fn get_mut_label(&mut self) -> &mut &'static str
pub fn set_label(&mut self, val: &'static str) -> &mut Self
pub fn get_disabled(&self) -> Signal<bool>
pub fn get_mut_disabled(&mut self) -> &mut Signal<bool>
pub fn set_disabled(&mut self, val: Signal<bool>) -> &mut Self
pub fn get_on_change(&self) -> Rc<dyn Fn(bool) + 'static>
pub fn try_get_on_change(&self) -> &Option<Rc<dyn Fn(bool) + 'static>>
pub fn get_mut_on_change(&mut self) -> &mut Option<Rc<dyn Fn(bool) + 'static>>
pub fn set_on_change( &mut self, val: Option<Rc<dyn Fn(bool) + 'static>>, ) -> &mut Self
Trait Implementations§
Source§impl Clone for EuvToggleProps
impl Clone for EuvToggleProps
Source§impl Debug for EuvToggleProps
impl Debug for EuvToggleProps
Auto Trait Implementations§
impl !RefUnwindSafe for EuvToggleProps
impl !Send for EuvToggleProps
impl !Sync for EuvToggleProps
impl !UnwindSafe for EuvToggleProps
impl Forget for EuvToggleProps
impl Freeze for EuvToggleProps
impl Move for EuvToggleProps
impl Unpin for EuvToggleProps
impl UnsafeUnpin for EuvToggleProps
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