pub enum State {
Show 13 variants
Prepare(PrepareData),
Stage(StageData),
Fetch(FetchData),
Commit(CommitData),
WaitToReboot(WaitToRebootData),
Reboot(RebootData),
DeferReboot(DeferRebootData),
Complete(CompleteData),
FailPrepare(FailPrepareData),
FailStage(FailStageData),
FailFetch(FailFetchData),
FailCommit(FailCommitData),
Canceled(CanceledData),
}
Expand description
The set of states that a [Monitor
] can receive during an update
installation attempt.
An installation attempt ends when it enters a terminal state, denoted below as the states on the right-hand side of the diagram with no arrows leading out of them.
§State Machine Diagram
+----------------+ +----------------+
+----------| prepare |---->| fail_prepare |
| +----------------+ +----------------+
| |
| v
| +----------------+ +----------------+
+----------| stage |---->| fail_stage |
| +----------------+ +----------------+
| |
| v
| +----------------+ +----------------+
+----------| fetch |---->| fail_fetch |
| +----------------+ +----------------+
| |
| v
| +----------------+ +----------------+
+----------| commit |---->| fail_commit |
| +----------------+ +----------------+
v |
+----------------+ | +----------------+
| canceled | +------------> | complete |
+----------------+ | +----------------+
v
+----------------+ +----------------+
| wait_to_reboot |---->| defer_reboot |
+----------------+ +----------------+
|
| +----------------+
+------------->| reboot |
+----------------+
Variants§
Prepare(PrepareData)
Fetching required metadata to begin the update and verifying system state.
Next States:
stage
system is ready to install the update.fail_prepare
on error.canceled
on cancel.
Stage(StageData)
Fetching and writing kernel and firmware images.
Next States:
fetch
required kernel and firmware images are written.fail_stage
on error.canceled
on cancel.
Fetch(FetchData)
Fetching packages.
Next States:
commit
packages were fetched successfully.fail_fetch
on error.canceled
on cancel.
Commit(CommitData)
Prepare to switch over to the new system by writing the packages and switching the active partition.
Next States:
wait_to_reboot
if a reboot is necessary to complete the update.complete
if no reboot is necessary to complete the update.fail_commit
on error.canceled
on cancel.
WaitToReboot(WaitToRebootData)
The system is configured to boot the updated OS on next boot, and the installer is waiting for the trigger to reboot the system.
Next States:
reboot
when the installer decides it is time to initiate the reboot.defer_reboot
if the initiator specifically requests to not reboot.
Reboot(RebootData)
The installer has initiated a system reboot into the updated OS.
This is a terminal state
DeferReboot(DeferRebootData)
The initiator specifically requested to skip the reboot, but a reboot is still required to complete the update.
This is a terminal state
Complete(CompleteData)
The update is complete and no reboot was required.
This is a terminal state
FailPrepare(FailPrepareData)
An error occurred while preparing the install.
This is a terminal state
FailStage(FailStageData)
An error occurred while staging the images for the OS.
This is a terminal state
FailFetch(FailFetchData)
An error occurred while fetching the required artifacts.
This is a terminal state
FailCommit(FailCommitData)
An error occured while switching partitions.
This is a terminal state
Canceled(CanceledData)
The update is canceled.
This is a terminal state
Implementations§
Trait Implementations§
Source§impl<D: ResourceDialect> Decode<State, D> for State
impl<D: ResourceDialect> Decode<State, D> for State
Source§impl TypeMarker for State
impl TypeMarker for State
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for State
impl ValueTypeMarker for State
impl Persistable for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations§
Source§impl<T> Body for Twhere
T: Persistable,
impl<T> Body for Twhere
T: Persistable,
Source§type MarkerAtTopLevel = T
type MarkerAtTopLevel = T
Source§type MarkerInResultUnion = T
type MarkerInResultUnion = T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)