morpheus_bootloader::tui::distro_downloader::state

Struct UiState

Source
pub struct UiState {
    pub selected_category: usize,
    pub selected_distro: usize,
    pub scroll_offset: usize,
    pub mode: UiMode,
    pub status_message: Option<&'static str>,
    pub selected_iso: usize,
    pub iso_count: usize,
}
Expand description

UI state for navigation

Fields§

§selected_category: usize

Currently selected category index

§selected_distro: usize

Currently selected distro index within category

§scroll_offset: usize

Scroll offset for distro list

§mode: UiMode

Current UI mode

§status_message: Option<&'static str>

Status message to display

§selected_iso: usize

Selected ISO index in manage view

§iso_count: usize

Total ISO count (cached from storage)

Implementations§

Source§

impl UiState

Source

pub const VISIBLE_ITEMS: usize = 8usize

Maximum visible items in distro list

Source

pub fn new() -> Self

Create new UI state

Source

pub fn next_category(&mut self, num_categories: usize)

Move to next category

Source

pub fn prev_category(&mut self)

Move to previous category

Source

pub fn next_distro(&mut self, num_distros: usize)

Move to next distro in list

Source

pub fn prev_distro(&mut self)

Move to previous distro in list

Source

pub fn start_download(&mut self)

Start download mode

Source

pub fn show_confirm(&mut self)

Show confirmation dialog

Source

pub fn return_to_browse(&mut self)

Return to browse mode

Source

pub fn show_result(&mut self, message: &'static str)

Show result mode

Source

pub fn current_category(&self) -> DistroCategory

Get current category

Source

pub fn set_status(&mut self, message: &'static str)

Set status message

Source

pub fn clear_status(&mut self)

Clear status message

Source

pub fn is_browsing(&self) -> bool

Check if in browsable state

Source

pub fn is_confirming(&self) -> bool

Check if showing confirmation

Source

pub fn is_downloading(&self) -> bool

Check if downloading

Source

pub fn show_manage(&mut self)

Switch to ISO management view

Source

pub fn return_from_manage(&mut self)

Return to browse from manage

Source

pub fn update_iso_count(&mut self, count: usize)

Update ISO count (call after storage changes)

Source

pub fn next_iso(&mut self)

Move to next ISO in manage list

Source

pub fn prev_iso(&mut self)

Move to previous ISO in manage list

Source

pub fn show_confirm_delete(&mut self)

Show confirm delete dialog

Source

pub fn cancel_confirm(&mut self)

Cancel confirmation and return to manage

Source

pub fn is_managing(&self) -> bool

Check if in manage mode

Trait Implementations§

Source§

impl Clone for UiState

Source§

fn clone(&self) -> UiState

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UiState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for UiState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.