morpheus_bootloader::tui::iso_manager::state

Struct IsoManagerState

Source
pub struct IsoManagerState {
    pub mode: ViewMode,
    pub selected: usize,
    pub count: usize,
    pub names: [[u8; 64]; 8],
    pub name_lens: [usize; 8],
    pub sizes_mb: [u64; 8],
    pub chunk_counts: [usize; 8],
    pub complete: [bool; 8],
    pub error_msg: Option<&'static str>,
}
Expand description

ISO manager state

Fields§

§mode: ViewMode

Current view mode

§selected: usize

Selected ISO index

§count: usize

Total number of ISOs

§names: [[u8; 64]; 8]

Cached ISO names for display (avoid repeated string ops)

§name_lens: [usize; 8]

Name lengths

§sizes_mb: [u64; 8]

Cached sizes (in MB)

§chunk_counts: [usize; 8]

Cached chunk counts

§complete: [bool; 8]

Cached completion status

§error_msg: Option<&'static str>

Error message to display (if any)

Implementations§

Source§

impl IsoManagerState

Source

pub fn new() -> Self

Create new state

Source

pub fn load_from_manager(&mut self, manager: &IsoStorageManager)

Load ISO data from storage manager

Source

pub fn selected_name(&self) -> &str

Get selected ISO name as str

Source

pub fn selected_size_mb(&self) -> u64

Get selected ISO size in MB

Source

pub fn selected_chunks(&self) -> usize

Get selected ISO chunk count

Source

pub fn selected_complete(&self) -> bool

Check if selected ISO is complete

Source

pub fn select_prev(&mut self)

Move selection up

Source

pub fn select_next(&mut self)

Move selection down

Source

pub fn handle_key(&mut self, scan_code: u16, unicode: u16) -> Action

Handle key input, return action

Source

fn handle_list_key(&mut self, scan_code: u16, unicode: u16) -> Action

Source

fn handle_details_key(&mut self, scan_code: u16, unicode: u16) -> Action

Source

fn handle_confirm_delete_key(&mut self, _scan_code: u16, unicode: u16) -> Action

Source

fn handle_confirm_boot_key(&mut self, _scan_code: u16, unicode: u16) -> Action

Source

pub fn set_error(&mut self, msg: &'static str)

Set error message

Source

pub fn clear_error(&mut self)

Clear error message

Trait Implementations§

Source§

impl Default for IsoManagerState

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> 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, 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.