pub struct ConfirmationFlow { /* private fields */ }Expand description
Manages the multi-step confirmation flow.
Implementations§
Source§impl ConfirmationFlow
impl ConfirmationFlow
Sourcepub fn new(config: ConfirmationConfig) -> Self
pub fn new(config: ConfirmationConfig) -> Self
Create a new confirmation flow with the given configuration.
Sourcepub fn current_step(&self) -> ConfirmationStep
pub fn current_step(&self) -> ConfirmationStep
Get the current step.
Sourcepub fn config(&self) -> &ConfirmationConfig
pub fn config(&self) -> &ConfirmationConfig
Get the configuration.
Sourcepub fn password_action(&self) -> Option<PasswordStrengthAction>
pub fn password_action(&self) -> Option<PasswordStrengthAction>
Get the password action if one was chosen.
Sourcepub fn should_skip_current(&self) -> bool
pub fn should_skip_current(&self) -> bool
Check if the current step should be skipped.
Sourcepub fn validate_secret_ack(&self, input: &str) -> StepValidation
pub fn validate_secret_ack(&self, input: &str) -> StepValidation
Validate input for the secret scan acknowledgment step.
Sourcepub fn validate_content_review(&self, input: &str) -> StepValidation
pub fn validate_content_review(&self, input: &str) -> StepValidation
Validate input for the content review step.
Sourcepub fn validate_public_warning(&self, input: &str) -> StepValidation
pub fn validate_public_warning(&self, input: &str) -> StepValidation
Validate input for the public publishing warning step.
Sourcepub fn parse_password_action(
&self,
input: &str,
) -> Option<PasswordStrengthAction>
pub fn parse_password_action( &self, input: &str, ) -> Option<PasswordStrengthAction>
Parse password strength action from input.
Sourcepub fn validate_recovery_key(&self, input: &str) -> StepValidation
pub fn validate_recovery_key(&self, input: &str) -> StepValidation
Validate input for the recovery key backup step.
Sourcepub fn process_final_enter(&mut self) -> bool
pub fn process_final_enter(&mut self) -> bool
Process an Enter keypress for final confirmation. Returns true if both Enter presses have been received.
Sourcepub fn reset_final_enter(&mut self)
pub fn reset_final_enter(&mut self)
Reset the final Enter counter (e.g., if user typed something else).
Sourcepub fn final_enter_count(&self) -> u8
pub fn final_enter_count(&self) -> u8
Get the number of Enter presses received for final confirmation.
Sourcepub fn complete_current_step(&mut self)
pub fn complete_current_step(&mut self)
Mark the current step as completed and advance to the next.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if all required steps are completed.
Sourcepub fn set_password_action(&mut self, action: PasswordStrengthAction)
pub fn set_password_action(&mut self, action: PasswordStrengthAction)
Set the password strength action.
Sourcepub fn completed_steps_summary(&self) -> Vec<(ConfirmationStep, &'static str)>
pub fn completed_steps_summary(&self) -> Vec<(ConfirmationStep, &'static str)>
Get the list of completed steps for display.
Auto Trait Implementations§
impl Freeze for ConfirmationFlow
impl RefUnwindSafe for ConfirmationFlow
impl Send for ConfirmationFlow
impl Sync for ConfirmationFlow
impl Unpin for ConfirmationFlow
impl UnsafeUnpin for ConfirmationFlow
impl UnwindSafe for ConfirmationFlow
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> 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