[][src]Struct dialoguer::Select

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

Renders a select prompt.

Methods

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

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

Creates a select prompt.

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

Creates a select prompt with a specific theme.

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

Enables or disables paging

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

Sets the clear behavior of the menu.

The default is to clear the menu.

pub fn default(&mut self, val: usize) -> &mut Select<'a>[src]

Sets a default for the menu

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

Add a single item to the selector.

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

Adds multiple items to the selector.

pub fn with_prompt<S: Into<String>>(&mut self, prompt: S) -> &mut Select<'a>[src]

Sets the select prompt.

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

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

Enables user interaction and returns the result.

The index of the selected item. The dialog is rendered on stderr.

pub fn interact_opt(&self) -> Result<Option<usize>>[src]

Enables user interaction and returns the result.

The index of the selected item. None if the user cancelled with Esc or 'q'. The dialog is rendered on stderr.

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

Like interact but allows a specific terminal to be set.

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

Like interact_opt but allows a specific terminal to be set.

Trait Implementations

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

Auto Trait Implementations

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

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

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

impl<'a> Unpin for Select<'a>

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

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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<V, T> VZip<V> for T where
    V: MultiLane<T>,