pub struct ResolvedPassword { /* private fields */ }Expand description
The outcome of read_password: the password, the source that won, and any
operator-facing warnings about sources that were configured but not used.
The warnings exist because a mistyped --keystore-password-file on a TTY
silently falls through to an interactive prompt — correct at the terminal,
but a different mode than the headless unit the operator ultimately deploys.
The caller decides where the warnings go: the CLI prints them to stderr
(decdn-incentive cannot, it denies print_stderr), the daemon logs them
through tracing.
Implementations§
Source§impl ResolvedPassword
impl ResolvedPassword
Sourcepub fn secret(&self) -> &str
pub fn secret(&self) -> &str
The resolved password. Borrowed as &str for the common case of
passing it straight to load_signer or stage_keystore.
Sourcepub const fn origin(&self) -> &PasswordOrigin
pub const fn origin(&self) -> &PasswordOrigin
Which source supplied the password.
Sourcepub fn warnings(&self) -> &[String]
pub fn warnings(&self) -> &[String]
Operator-facing warnings about configured-but-unused sources, in source
order. Empty in the common case. Each is a complete sentence with no
warning: prefix and never contains the password.
Sourcepub fn into_secret(self) -> Zeroizing<String>
pub fn into_secret(self) -> Zeroizing<String>
Consume the outcome and yield the password, still zeroized on drop. Use
when the secret must be moved (e.g. into a spawn_blocking closure)
after the warnings and origin have been inspected.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResolvedPassword
impl RefUnwindSafe for ResolvedPassword
impl Send for ResolvedPassword
impl Sync for ResolvedPassword
impl Unpin for ResolvedPassword
impl UnsafeUnpin for ResolvedPassword
impl UnwindSafe for ResolvedPassword
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
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