Skip to main content

Choices

Struct Choices 

Source
pub struct Choices<M> { /* private fields */ }
Expand description

Options to pick from on a Notice, like the answers to a question: one, which a click sends, or several, checked and then sent together.

Implementations§

Source§

impl<M> Choices<M>

Source

pub fn one() -> Self

A click on an option sends its message: that’s the answer.

Source

pub fn many() -> Self

A click on an option sends its message, to check or uncheck it, and on_send sends what’s checked.

Source

pub fn option( self, label: impl Into<String>, description: Option<String>, picked: bool, on_pick: M, ) -> Self

An option, with a line saying what it means, and whether it’s checked.

Source

pub fn recommended(self) -> Self

The option just added is the one to suggest.

Source

pub fn on_send(self, message: M) -> Self

Sent by the button that sends what’s checked, for many.

Auto Trait Implementations§

§

impl<M> Freeze for Choices<M>
where ChoicesParts<M>: Freeze,

§

impl<M> RefUnwindSafe for Choices<M>
where ChoicesParts<M>: RefUnwindSafe,

§

impl<M> Send for Choices<M>
where ChoicesParts<M>: Send,

§

impl<M> Sync for Choices<M>
where ChoicesParts<M>: Sync,

§

impl<M> Unpin for Choices<M>
where ChoicesParts<M>: Unpin,

§

impl<M> UnsafeUnpin for Choices<M>
where ChoicesParts<M>: UnsafeUnpin,

§

impl<M> UnwindSafe for Choices<M>
where ChoicesParts<M>: UnwindSafe,

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> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,

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.