[][src]Struct dialoguer::Checkboxes

pub struct Checkboxes<'a> { /* fields omitted */ }

Renders a multi select checkbox menu.

Methods

impl<'a> Checkboxes<'a>[src]

pub fn new() -> Checkboxes<'static>[src]

Creates a new checkbox object.

pub fn with_theme(theme: &'a dyn Theme) -> Checkboxes<'a>[src]

Sets a theme other than the default one.

pub fn paged(&mut self, val: bool) -> &mut Checkboxes<'a>[src]

Enables or disables paging

pub fn clear(&mut self, val: bool) -> &mut Checkboxes<'a>[src]

Sets the clear behavior of the checkbox menu.

The default is to clear the checkbox menu.

pub fn defaults(&mut self, val: &[bool]) -> &mut Checkboxes<'a>[src]

Sets a defaults for the menu

pub fn item(&mut self, item: &str) -> &mut Checkboxes<'a>[src]

Add a single item to the selector.

pub fn item_checked(&mut self, item: &str, checked: bool) -> &mut Checkboxes<'a>[src]

Add a single item to the selector with a default checked state.

pub fn items<T: ToString>(&mut self, items: &[T]) -> &mut Checkboxes<'a>[src]

Adds multiple items to the selector.

pub fn items_checked<T: ToString>(
    &mut self,
    items: &[(T, bool)]
) -> &mut Checkboxes<'a>
[src]

Adds multiple items to the selector with checked state

pub fn with_prompt(&mut self, prompt: &str) -> &mut Checkboxes<'a>[src]

Prefaces the menu with a prompt.

When a prompt is set the system also prints out a confirmation after the selection.

pub fn interact(&self) -> Result<Vec<usize>>[src]

Enables user interaction and returns the result.

The user can select the items with the space bar and on enter the selected items will be returned.

pub fn interact_on(&self, term: &Term) -> Result<Vec<usize>>[src]

Like interact but allows a specific terminal to be set.

Trait Implementations

impl<'a> Default for Checkboxes<'a>[src]

Auto Trait Implementations

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

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

impl<'a> Unpin for Checkboxes<'a>

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

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

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]