pub struct KeySetupMachine { /* private fields */ }Expand description
State machine for tracking key setup progress.
Implementations§
Source§impl KeySetupMachine
impl KeySetupMachine
Sourcepub fn state(&self) -> &KeySetupState
pub fn state(&self) -> &KeySetupState
Returns the current state.
Sourcepub fn set_has_sudo(&mut self, has_sudo: bool)
pub fn set_has_sudo(&mut self, has_sudo: bool)
Sets the sudo availability flag.
Sourcepub fn step_result(&mut self, step: KeySetupStep, result: Result<()>)
pub fn step_result(&mut self, step: KeySetupStep, result: Result<()>)
Marks a step as complete with the given result.
Updates the state machine based on which step completed and whether it succeeded. Implements the safety invariants from tech-2.md B.3.3.
Sourcepub fn rollback_complete(&mut self)
pub fn rollback_complete(&mut self)
Marks the rollback as complete.
Trait Implementations§
Source§impl Debug for KeySetupMachine
impl Debug for KeySetupMachine
Auto Trait Implementations§
impl Freeze for KeySetupMachine
impl RefUnwindSafe for KeySetupMachine
impl Send for KeySetupMachine
impl Sync for KeySetupMachine
impl Unpin for KeySetupMachine
impl UnsafeUnpin for KeySetupMachine
impl UnwindSafe for KeySetupMachine
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