[][src]Trait dialoguer::Validator

pub trait Validator {
    type Err: Debug + Display;
    fn validate(&self, text: &str) -> Result<(), Self::Err>;
}

Associated Types

type Err: Debug + Display

Loading content...

Required methods

fn validate(&self, text: &str) -> Result<(), Self::Err>

Invoked with the value to validate.

If this produces Ok(()) then the value is used and parsed, if an error is returned validation fails with that error.

Loading content...

Implementors

impl<T: Fn(&str) -> Result<(), E>, E: Debug + Display> Validator for T[src]

type Err = E

Loading content...