[][src]Struct read_input::InputBuilder

pub struct InputBuilder<T: FromStr> { /* fields omitted */ }

'builder' used to store the settings that are used to fetch input.

.get() method only takes these settings by reference so can be called multiple times.

This type does not have support for default input value.

Methods

impl<T: FromStr> InputBuilder<T>[src]

pub fn new() -> Self[src]

Creates a new instance of InputBuilder with default settings.

pub fn get(&self) -> T[src]

'gets' the input form the user.

Panics if unable to read input line.

pub fn try_get(&self) -> Result<T>[src]

'gets' the input form the user.

Errors

Returns Err if unable to read input line.

pub fn default(self, default: T) -> InputBuilderOnce<T>[src]

Changes or adds a default input value.

Trait Implementations

impl<T: FromStr + Clone> Clone for InputBuilder<T>[src]

impl<T: FromStr> Default for InputBuilder<T>[src]

impl<T: FromStr> InputBuild<T> for InputBuilder<T>[src]

impl<T: FromStr + PartialOrd + 'static> InputConstraints<T> for InputBuilder<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for InputBuilder<T>

impl<T> !Send for InputBuilder<T>

impl<T> !Sync for InputBuilder<T>

impl<T> Unpin for InputBuilder<T>

impl<T> !UnwindSafe for InputBuilder<T>

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.