expression

Separate trial boot from confirmed firmware

A firmware update may be tried before it is permanently accepted. This state model chooses confirmation only when health checks pass; it is not a bootloader or a flash algorithm. Power-loss recovery requires a real persistent state protocol, validated image authenticity, hardware-specific erase and write behavior and recovery tests. Expected host stdout (not executed): trial outcomes checked Common mistake: Marking an update confirmed immediately on entry before required health checks complete.

Formal Syntax & Structure

rust syntaxrust
BootState::{Trial, Confirmed, RollbackRequested}

Working Example

Example Snippetrust
#![no_std]#[derive(Clone, Copy, PartialEq, Eq, Debug)]pub enum BootState { Trial, Confirmed, RollbackRequested }pub fn health_result(healthy: bool) -> BootState {    if healthy { BootState::Confirmed } else { BootState::RollbackRequested }}
Rust Reference