pub struct PasswordPrompt { /* private fields */ }Expand description
Password prompt component for sudo authentication
Implementations§
Source§impl PasswordPrompt
impl PasswordPrompt
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Check if the prompt is visible
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Check if authentication was successful
Sourcepub fn mark_authenticated_for_tests(&mut self)
pub fn mark_authenticated_for_tests(&mut self)
Force the “already authenticated this session” flag for tests,
without shelling out to a real sudo process. Only compiled into
debug builds (which is what cargo test uses), never shipped in a
release binary.
Sourcepub fn remove_char(&mut self)
pub fn remove_char(&mut self)
Remove the last character from the password input
Sourcepub fn verify_password(&mut self) -> Result<bool>
pub fn verify_password(&mut self) -> Result<bool>
Verify the password using sudo (delegates to shared core logic).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PasswordPrompt
impl RefUnwindSafe for PasswordPrompt
impl Send for PasswordPrompt
impl Sync for PasswordPrompt
impl Unpin for PasswordPrompt
impl UnsafeUnpin for PasswordPrompt
impl UnwindSafe for PasswordPrompt
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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