Skip to main content

tinyboot_core/traits/
app.rs

1/// App-side boot client interface.
2///
3/// Provides the operations an application needs from the bootloader:
4/// confirming a successful trial boot, requesting bootloader entry
5/// for a firmware update, and performing a system reset.
6pub trait BootClient {
7    /// Confirm a successful boot.
8    ///
9    /// If the boot state is `Validating`, refreshes metadata back to Idle.
10    /// Otherwise does nothing (already confirmed or no update in progress).
11    fn confirm(&mut self);
12
13    /// Set the boot request flag so the next reset enters the bootloader.
14    fn request_update(&mut self);
15
16    /// Reset the system. This function does not return.
17    fn system_reset(&mut self) -> !;
18}