[][src]Struct ahum_dialoguer::FileInput

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

Renders a file input

Methods

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

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

Creates a new input prompt.

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

Creates an input with a specific theme.

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

Sets the input prompt.

pub fn default(&mut self, value: PathBuf) -> &mut FileInput<'a>[src]

Sets a default.

Out of the box the prompt does not have a default and will continue to display until the user hit enter. If a default is set the user can instead accept the default with enter.

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

Enables or disables an empty input

By default, if there is no default value set for the input, the user must input a non-empty string.

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

Disables or enables the default value display.

The default is to append [default] to the prompt to tell the user that a default is acceptable.

pub fn validate_with<V: Validator + 'static>(
    &mut self,
    validator: V
) -> &mut FileInput<'a>
[src]

Registers a validator.

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

Enables user interaction and returns the result.

If the user confirms the result is true, false otherwise. The dialog is rendered on stderr.

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

Like interact but allows a specific terminal to be set.

Auto Trait Implementations

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

impl<'a> !Sync for FileInput<'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]