pub struct FlashKraft {Show 21 fields
pub selected_image: Option<ImageInfo>,
pub selected_target: Option<DriveInfo>,
pub available_drives: Vec<DriveInfo>,
pub flash_progress: Option<f32>,
pub flash_bytes_written: u64,
pub flash_speed_mb_s: f32,
pub flash_stage: String,
pub verify_progress: Option<f32>,
pub verify_speed_mb_s: f32,
pub verify_phase: &'static str,
pub error_message: Option<String>,
pub device_selection_open: bool,
pub flashing_active: bool,
pub flash_complete: bool,
pub flash_cancel_token: Arc<AtomicBool>,
pub flash_run_id: u64,
pub theme: Theme,
pub storage: Option<Storage>,
pub animated_progress: AnimatedProgress,
pub verify_animated_progress: AnimatedProgress,
pub animation_time: f32,
}Expand description
The main application state
This struct represents the complete state of the FlashKraft application.
All state is managed immutably and changes only through the update function.
Fields§
§selected_image: Option<ImageInfo>Currently selected image file
selected_target: Option<DriveInfo>Currently selected target drive
available_drives: Vec<DriveInfo>List of available drives detected on the system
flash_progress: Option<f32>Current flash progress (0.0 to 1.0), None if not flashing
flash_bytes_written: u64Bytes written during flash operation
flash_speed_mb_s: f32Current transfer speed in MB/s
flash_stage: StringCurrent pipeline stage label (e.g. “Writing image to device…”, “Verifying written data…”)
verify_progress: Option<f32>Verification overall progress (0.0–1.0 across both image-hash and device read-back passes).
None when verification has not started yet.
verify_speed_mb_s: f32Current verification read speed in MB/s (0.0 when not verifying).
verify_phase: &'static strWhich verification pass is active: "image" or "device". Empty when not verifying.
error_message: Option<String>Error message if an error occurred
device_selection_open: boolWhether the device selection view is currently open
flashing_active: boolWhether a flash operation is currently active (for subscription).
Remains true through the entire pipeline including verification —
only set to false when FlashCompleted arrives.
flash_complete: boolSet to true when FlashCompleted(Ok(())) arrives.
Distinct from flashing_active so the view can show the complete
screen without killing the subscription prematurely.
flash_cancel_token: Arc<AtomicBool>Cancellation token for flash operation
flash_run_id: u64Monotonically increasing counter incremented on every new flash attempt. Included in the subscription ID hash so that flashing the same image to the same device a second time always creates a fresh subscription instead of reusing the completed (pending) one from the previous run.
theme: ThemeCurrently selected theme
storage: Option<Storage>Storage for persistent preferences
animated_progress: AnimatedProgressAnimated progress bar for flash operations
verify_animated_progress: AnimatedProgressSeparate green animated progress bar shown during verification.
animation_time: f32Animation time for progress line glow effects (0.0 to infinity)
Implementations§
Source§impl FlashKraft
impl FlashKraft
Sourcepub fn is_ready_to_flash(&self) -> bool
pub fn is_ready_to_flash(&self) -> bool
Check if the application is ready to flash
Returns true if both an image and target are selected
Sourcepub fn is_flashing(&self) -> bool
pub fn is_flashing(&self) -> bool
Check if a flash operation is currently in progress
Sourcepub fn is_flash_complete(&self) -> bool
pub fn is_flash_complete(&self) -> bool
Check if the flash operation is complete (pipeline finished successfully).
Sourcepub fn cancel_selections(&mut self)
pub fn cancel_selections(&mut self)
Cancel current selections
Sourcepub fn begin_flash_state(&mut self)
pub fn begin_flash_state(&mut self)
Prepare state for a new flash attempt.
Source§impl FlashKraft
impl FlashKraft
Sourcepub fn view(&self) -> Element<'_, Message>
pub fn view(&self) -> Element<'_, Message>
Render the user interface
This is a pure function that describes what the UI should look like based on the current state.
§Returns
An Element describing the UI to render
Sourcepub fn subscription(&self) -> Subscription<Message>
pub fn subscription(&self) -> Subscription<Message>
Subscribe to long-running operations
This enables streaming progress updates from the flash operation, animation ticks for the progress bar, and automatic USB hotplug detection (so the drive list updates without the user pressing Refresh).
§Returns
A Subscription that emits messages for ongoing operations
Trait Implementations§
Source§impl Debug for FlashKraft
impl Debug for FlashKraft
Auto Trait Implementations§
impl !Freeze for FlashKraft
impl !RefUnwindSafe for FlashKraft
impl !Sync for FlashKraft
impl Send for FlashKraft
impl Unpin for FlashKraft
impl UnsafeUnpin for FlashKraft
impl UnwindSafe for FlashKraft
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more