Skip to main content

FlashRuntime

Trait FlashRuntime 

Source
pub trait FlashRuntime<E> {
    // Required methods
    fn elapsed(&self) -> Duration;
    fn sleep(&mut self, duration: Duration);

    // Provided methods
    fn starting(&mut self, _bytes: usize) { ... }
    fn progress(&mut self, _written: usize, _total: usize) { ... }
    fn recovery_entry_failed(&mut self, _error: &Error<E>) { ... }
    fn commit_failed(&mut self, _error: &Error<E>) { ... }
    fn commit_not_ready(&mut self, _error: &Error<E>) { ... }
    fn status(&mut self, _stage: Stage, _status: Status<'_, E>) { ... }
    fn uploaded(&mut self, _bytes: usize) { ... }
    fn poll_failed(&mut self, _elapsed: Duration, _error: &Error<E>) { ... }
    fn verifying(&mut self) { ... }
    fn unverified(&mut self, _offset: usize, _length: usize, _error: &Error<E>) { ... }
}
Expand description

Host timing and progress for receiver-bound update execution.

Required Methods§

Source

fn elapsed(&self) -> Duration

Monotonic time from a fixed origin; must advance across FlashRuntime::sleep.

Source

fn sleep(&mut self, duration: Duration)

Wait at least duration.

Provided Methods§

Source

fn starting(&mut self, _bytes: usize)

The session is about to start; bytes will be streamed.

Source

fn progress(&mut self, _written: usize, _total: usize)

A STREAM write completed.

Source

fn recovery_entry_failed(&mut self, _error: &Error<E>)

Explicit Recovery only: PREPARE failed, was not retried, and recovery proceeds to the selected image. Hosts should persist the full error. Normal Flash never invokes this callback and aborts on entry failure.

Source

fn commit_failed(&mut self, _error: &Error<E>)

COMMIT failed. The drive programmed when the last chunk landed and may answer COMMIT while it reinitializes, so the flash goes on to its checks.

Source

fn commit_not_ready(&mut self, _error: &Error<E>)

TEST UNIT READY right after COMMIT failed; expected while programming.

Source

fn status(&mut self, _stage: Stage, _status: Status<'_, E>)

A REQUEST SENSE outcome that does not fail the flash.

Source

fn uploaded(&mut self, _bytes: usize)

The upload is complete; readiness polling starts.

Source

fn poll_failed(&mut self, _elapsed: Duration, _error: &Error<E>)

A readiness poll failed after elapsed of polling.

Source

fn verifying(&mut self)

Read-back verification starts.

Source

fn unverified(&mut self, _offset: usize, _length: usize, _error: &Error<E>)

A chunk holding protected bytes could not be read back in full.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§