[−][src]Struct ahum_dialoguer::PasswordInput
Renders a password input prompt.
Example usage
use ahum_dialoguer::PasswordInput; let password = PasswordInput::new().with_prompt("New Password") .with_confirmation("Confirm password", "Passwords mismatching") .interact()?; println!("Length of the password is: {}", password.len());
Methods
impl<'a> PasswordInput<'a>
[src]
pub fn new() -> PasswordInput<'static>
[src]
Creates a new input prompt.
pub fn with_theme(theme: &'a dyn Theme) -> PasswordInput<'a>
[src]
Creates the password input with a specific theme.
pub fn with_prompt(&mut self, prompt: &str) -> &mut PasswordInput<'a>
[src]
Sets the prompt.
pub fn with_confirmation(
&mut self,
prompt: &str,
mismatch_err: &str
) -> &mut PasswordInput<'a>
[src]
&mut self,
prompt: &str,
mismatch_err: &str
) -> &mut PasswordInput<'a>
Enables confirmation prompting.
pub fn allow_empty_password(
&mut self,
allow_empty_password: bool
) -> &mut PasswordInput<'a>
[src]
&mut self,
allow_empty_password: bool
) -> &mut PasswordInput<'a>
Allows/Disables empty password.
By default this setting is set to false (i.e. password is not empty).
pub fn interact(&self) -> Result<String>
[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<String>
[src]
Like interact
but allows a specific terminal to be set.
Auto Trait Implementations
impl<'a> !Send for PasswordInput<'a>
impl<'a> !Sync for PasswordInput<'a>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,