pub enum State {
Show 13 variants
Prepare,
Stage(UpdateInfoAndProgress),
Fetch(UpdateInfoAndProgress),
Commit(UpdateInfoAndProgress),
WaitToReboot(UpdateInfoAndProgress),
Reboot(UpdateInfoAndProgress),
DeferReboot(UpdateInfoAndProgress),
Complete(UpdateInfoAndProgress),
FailPrepare(PrepareFailureReason),
FailStage(FailStageData),
FailFetch(FailFetchData),
FailCommit(UpdateInfoAndProgress),
Canceled,
}
Expand description
The state of an update installation attempt.
Variants§
Prepare
Stage(UpdateInfoAndProgress)
Fetch(UpdateInfoAndProgress)
Commit(UpdateInfoAndProgress)
WaitToReboot(UpdateInfoAndProgress)
Reboot(UpdateInfoAndProgress)
DeferReboot(UpdateInfoAndProgress)
Complete(UpdateInfoAndProgress)
FailPrepare(PrepareFailureReason)
FailStage(FailStageData)
FailFetch(FailFetchData)
FailCommit(UpdateInfoAndProgress)
Canceled
Implementations§
Source§impl State
impl State
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Determines if this state is terminal and represents a successful attempt.
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Determines if this state is terminal and represents a failure.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Determines if this state is terminal (terminal states are final, no further state transitions should occur).
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Returns the name of the state, intended for use in log/diagnostics output.
Sourcepub fn write_to_inspect(&self, node: &Node)
pub fn write_to_inspect(&self, node: &Node)
Serializes this state to a Fuchsia Inspect node.
Sourcepub fn download_size(&self) -> Option<u64>
pub fn download_size(&self) -> Option<u64>
Extracts the download_size field in UpdateInfo, if the state supports it.
Trait Implementations§
Source§impl Arbitrary for State
impl Arbitrary for State
Source§type Parameters = (<UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <PrepareFailureReason as Arbitrary>::Parameters, <FailStageData as Arbitrary>::Parameters, (<FailFetchData as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters))
type Parameters = (<UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters, <PrepareFailureReason as Arbitrary>::Parameters, <FailStageData as Arbitrary>::Parameters, (<FailFetchData as Arbitrary>::Parameters, <UpdateInfoAndProgress as Arbitrary>::Parameters))
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.Source§type Strategy = TupleUnion<((u32, Arc<fn() -> State>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<PrepareFailureReason as Arbitrary>::Strategy, fn(_: PrepareFailureReason) -> State>>), (u32, Arc<TupleUnion<((u32, Arc<Map<<FailStageData as Arbitrary>::Strategy, fn(_: FailStageData) -> State>>), (u32, Arc<Map<<FailFetchData as Arbitrary>::Strategy, fn(_: FailFetchData) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<fn() -> State>))>>))>
type Strategy = TupleUnion<((u32, Arc<fn() -> State>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<Map<<PrepareFailureReason as Arbitrary>::Strategy, fn(_: PrepareFailureReason) -> State>>), (u32, Arc<TupleUnion<((u32, Arc<Map<<FailStageData as Arbitrary>::Strategy, fn(_: FailStageData) -> State>>), (u32, Arc<Map<<FailFetchData as Arbitrary>::Strategy, fn(_: FailFetchData) -> State>>), (u32, Arc<Map<<UpdateInfoAndProgress as Arbitrary>::Strategy, fn(_: UpdateInfoAndProgress) -> State>>), (u32, Arc<fn() -> State>))>>))>
The type of
Strategy
used to generate values of type Self
.Source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
Source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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> 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> 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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)