Skip to main content

BootMetaStore

Trait BootMetaStore 

Source
pub trait BootMetaStore {
    type Error: Debug;

    // Required methods
    fn boot_state(&self) -> BootState;
    fn has_trials(&self) -> bool;
    fn app_checksum(&self) -> u16;
    fn app_size(&self) -> u32;
    fn advance(&mut self) -> Result<BootState, Self::Error>;
    fn consume_trial(&mut self) -> Result<(), Self::Error>;
    fn refresh(
        &mut self,
        checksum: u16,
        state: BootState,
        app_size: u32,
    ) -> Result<(), Self::Error>;
}
Expand description

Persistent boot metadata storage.

Required Associated Types§

Source

type Error: Debug

Error type for metadata operations.

Required Methods§

Source

fn boot_state(&self) -> BootState

Current boot lifecycle state.

Source

fn has_trials(&self) -> bool

Returns true if any trial boots remain.

Source

fn app_checksum(&self) -> u16

Stored CRC16 of the application firmware.

Source

fn app_size(&self) -> u32

Stored application size in bytes.

Source

fn advance(&mut self) -> Result<BootState, Self::Error>

Step state down by one (1→0 bit clear).

Source

fn consume_trial(&mut self) -> Result<(), Self::Error>

Consume one trial boot (clears one bit in the trials field).

Source

fn refresh( &mut self, checksum: u16, state: BootState, app_size: u32, ) -> Result<(), Self::Error>

Erase meta and rewrite with given checksum, state, and app_size. Trials return to erased default (full).

Implementors§