Trait wasefire_board_api::platform::update::Api

source ·
pub trait Api: Support<bool> + Send {
    // Required methods
    fn metadata() -> Result<Box<[u8]>, Error>;
    fn initialize(dry_run: bool) -> Result<(), Error>;
    fn process(chunk: &[u8]) -> Result<(), Error>;
    fn finalize() -> Result<(), Error>;
}
Available on crate features internal-api-platform and api-platform-update only.
Expand description

Platform update interface.

Required Methods§

source

fn metadata() -> Result<Box<[u8]>, Error>

Returns the metadata of the platform.

This typically contains the version and side (A or B) of the running platform.

source

fn initialize(dry_run: bool) -> Result<(), Error>

Starts a platform update process.

During a dry-run, any mutable operation is skipped and only checks are performed.

source

fn process(chunk: &[u8]) -> Result<(), Error>

Processes the next chunk of a platform update.

source

fn finalize() -> Result<(), Error>

Finalizes a platform update process.

This function will reboot when the update is successful and thus only returns in case of errors or in dry-run mode.

Object Safety§

This trait is not object safe.

Implementors§