flash

Function flash 

Source
pub fn flash<R: Read>(
    img_resolver: impl FnOnce() -> Result<(R, u64)>,
    dst: &Path,
    chan: Option<Sender<f32>>,
    customization: Option<Customization>,
    cancel: Option<Weak<()>>,
) -> Result<(), Error>
Expand description

Flash OS image to SD card.

§Customization

Support post flashing customization. Currently only sysconf is supported, which is used by BeagleBoard.org.

§Image

Using a resolver function for image and image size. This is to allow downloading the image, or some kind of lazy loading after SD card permissions have be acquired. This is useful in GUIs since the user would expect a password prompt at the start of flashing.

Many users might switch task after starting the flashing process, which would make it frustrating if the prompt occured after downloading.

§Progress

Progress lies between 0 and 1.

§Aborting

The process can be aborted by dropping all strong references to the Arc that owns the Weak passed as cancel.