Struct moonboot::MoonbootManager
source · [−]pub struct MoonbootManager<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> { /* private fields */ }
Expand description
Instantiate this in your application to enable mutation of the State specified in this and jump to the bootloader to apply any updates.
Implementations
sourceimpl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
impl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
pub fn new(
config: Config,
internal_memory: InternalMemory,
state: HardwareState,
processor: CPU
) -> MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
sourcepub fn destroy(self) -> (InternalMemory, HardwareState, CPU)
pub fn destroy(self) -> (InternalMemory, HardwareState, CPU)
Destroy this instance of the boot manager and return access to the hardware peripheral
sourcepub fn mark_boot_successful(&mut self) -> Result<(), ()>
pub fn mark_boot_successful(&mut self) -> Result<(), ()>
Run this immediately after booting your new image successfully to mark the boot as succesful. If you do not do this, any reset will cause the bootloader to restore to the previous firmware image.
pub fn update(&mut self) -> Result<Void, ()>
Trait Implementations
sourceimpl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> AsRef<[u8]> for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
impl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> AsRef<[u8]> for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
Easily get read access to the update bank
sourceimpl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> ReadStorage for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
impl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> ReadStorage for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
Read Access to the current update target slot
Auto Trait Implementations
impl<InternalMemory, HardwareState, CPU, const INTERNAL_PAGE_SIZE: usize> RefUnwindSafe for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE> where
CPU: RefUnwindSafe,
HardwareState: RefUnwindSafe,
InternalMemory: RefUnwindSafe,
impl<InternalMemory, HardwareState, CPU, const INTERNAL_PAGE_SIZE: usize> Send for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE> where
CPU: Send,
HardwareState: Send,
InternalMemory: Send,
impl<InternalMemory, HardwareState, CPU, const INTERNAL_PAGE_SIZE: usize> Sync for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE> where
CPU: Sync,
HardwareState: Sync,
InternalMemory: Sync,
impl<InternalMemory, HardwareState, CPU, const INTERNAL_PAGE_SIZE: usize> Unpin for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE> where
CPU: Unpin,
HardwareState: Unpin,
InternalMemory: Unpin,
impl<InternalMemory, HardwareState, CPU, const INTERNAL_PAGE_SIZE: usize> UnwindSafe for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE> where
CPU: UnwindSafe,
HardwareState: UnwindSafe,
InternalMemory: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more