Skip to main content

ToggleBuilder

Struct ToggleBuilder 

Source
pub struct ToggleBuilder<'a> { /* private fields */ }
Expand description

Chainable toggle.

Implementations§

Source§

impl<'a> SwitchBuilder<'a>

Source

pub fn build_response<'c, C: ContentCx<'c>>(self, cx: &mut C) -> Response

build, name it for assistive tech, and report: checked is the new state, changed a user flip.

Source§

impl<'a> ToggleBuilder<'a>

Source

pub fn toggled(self, on: bool) -> Self

On, ignored when ToggleBuilder::bind is set.

Source

pub fn bind(self, flag: &'a mut bool) -> Self

Read *flag for paint and flip it when clicked and not disabled.

Source

pub fn label(self, l: &'a str) -> Self

Label.

Source

pub fn disabled(self, on: bool) -> Self

Disabled colours; bind does not flip.

Source

pub fn kind(self, k: ToggleRenderKind<'a>) -> Self

Render kind.

Source

pub fn settings(self, s: ToggleSettings) -> Self

Full settings.

Source

pub fn build<'c, C: ContentCx<'c>>(self, cx: &mut C) -> bool

Register and draw into cx. Returns the on state it painted.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for ToggleBuilder<'a>

§

impl<'a> !Send for ToggleBuilder<'a>

§

impl<'a> !Sync for ToggleBuilder<'a>

§

impl<'a> !UnwindSafe for ToggleBuilder<'a>

§

impl<'a> Forget for ToggleBuilder<'a>

§

impl<'a> Freeze for ToggleBuilder<'a>

§

impl<'a> Move for ToggleBuilder<'a>

§

impl<'a> Unpin for ToggleBuilder<'a>

§

impl<'a> UnsafeUnpin for ToggleBuilder<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.