Struct dialoguer::Password [−][src]
Renders a password input prompt.
Example usage
use dialoguer::Password; let password = Password::new().with_prompt("New Password") .with_confirmation("Confirm password", "Passwords mismatching") .interact()?; println!("Length of the password is: {}", password.len());
Implementations
impl<'a> Password<'a>
[src]
pub fn new() -> Password<'static>
[src]
Creates a password input prompt.
pub fn with_theme(theme: &'a dyn Theme) -> Password<'a>
[src]
Creates a password input prompt with a specific theme.
pub fn with_prompt<S: Into<String>>(&mut self, prompt: S) -> &mut Password<'a>
[src]
Sets the password input prompt.
pub fn with_confirmation<A, B>(
&mut self,
prompt: A,
mismatch_err: B
) -> &mut Password<'a> where
A: Into<String>,
B: Into<String>,
[src]
&mut self,
prompt: A,
mismatch_err: B
) -> &mut Password<'a> where
A: Into<String>,
B: Into<String>,
Enables confirmation prompting.
pub fn allow_empty_password(
&mut self,
allow_empty_password: bool
) -> &mut Password<'a>
[src]
&mut self,
allow_empty_password: bool
) -> &mut Password<'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.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Password<'a>
impl<'a> !Send for Password<'a>
impl<'a> !Sync for Password<'a>
impl<'a> Unpin for Password<'a>
impl<'a> !UnwindSafe for Password<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,