pub enum PasswordSource {
Env(&'static str),
File(PathBuf),
Prompt {
usage: PasswordUse,
},
}Expand description
Source for the keystore password, in precedence order. The first source in the slice that is present wins, and it supplies its value as-is — the empty string included, because an empty password is a legitimate Web3 Secret Storage password. Presence, not emptiness, decides: a source that is not there falls through to the next entry.
Variants§
Env(&'static str)
Process environment variable. Present when the variable is set; its value is the password, empty included. An unset variable falls through; a value that is not valid UTF-8 is an error, because the variable is there and the operator meant it to be read.
File(PathBuf)
File whose contents are the password. A single trailing \n (or
\r\n) is stripped; other whitespace is part of the password. Present
when the file exists — an empty file is an empty password. A path that
does not exist falls through; any other read failure is an error.
Prompt
Interactive prompt via rpassword. Present when stdin is a TTY; a
non-TTY stdin falls through. An empty entry is an empty password.
PasswordUse::Create re-prompts and verifies the entries match.
Fields
usage: PasswordUseWhat the password is for; see PasswordUse. Create prompts
twice and requires both entries to match, Unlock takes the single
entry as given.
Trait Implementations§
Source§impl Clone for PasswordSource
impl Clone for PasswordSource
Auto Trait Implementations§
impl Freeze for PasswordSource
impl RefUnwindSafe for PasswordSource
impl Send for PasswordSource
impl Sync for PasswordSource
impl Unpin for PasswordSource
impl UnsafeUnpin for PasswordSource
impl UnwindSafe for PasswordSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more