Skip to main content

App

Struct App 

Source
pub struct App {
Show 24 fields pub state: AppState, pub scan_mode: ScanMode, pub menu_index: usize, pub projects: Vec<ProjectEntry>, pub caches: Vec<CacheEntry>, pub cleaners: Vec<CleanerEntry>, pub selected: usize, pub scroll_offset: usize, pub expanded: HashSet<usize>, pub status_message: Option<String>, pub should_quit: bool, pub show_help: bool, pub current_tab: usize, pub tabs: Vec<String>, pub search_query: String, pub is_searching: bool, pub scan_paths: Vec<PathBuf>, pub scan_progress: f64, pub scan_message: String, pub dirs_scanned: usize, pub total_size: u64, pub anim_frame: usize, pub permanent_delete: bool, pub pending_delete_items: Vec<(PathBuf, Option<String>)>, /* private fields */
}
Expand description

Main TUI application state

Fields§

§state: AppState

Current screen/state

§scan_mode: ScanMode

Selected scan mode

§menu_index: usize

Menu selection index (for ready screen)

§projects: Vec<ProjectEntry>

Projects to display

§caches: Vec<CacheEntry>

Caches to display

§cleaners: Vec<CleanerEntry>

Cleaner items to display

§selected: usize

Currently selected index

§scroll_offset: usize

Scroll offset for the list

§expanded: HashSet<usize>

Expanded project indices

§status_message: Option<String>

Status message

§should_quit: bool

Should quit

§show_help: bool

Show help popup

§current_tab: usize

Current tab/category

§tabs: Vec<String>

Available tabs

§search_query: String

Search query

§is_searching: bool

Is searching

§scan_paths: Vec<PathBuf>

Scan paths

§scan_progress: f64

Scan progress (0.0 - 1.0)

§scan_message: String

Scan message

§dirs_scanned: usize

Directories scanned

§total_size: u64

Total size found

§anim_frame: usize

Animation frame counter

§permanent_delete: bool

Use permanent delete (rm -rf) instead of trash

§pending_delete_items: Vec<(PathBuf, Option<String>)>

Items pending deletion (path, optional clean_command)

Implementations§

Source§

impl App

Source

pub fn new(paths: Vec<PathBuf>) -> Self

Create a new app with scan paths

Source

pub fn toggle_permanent_delete(&mut self)

Toggle permanent delete option

Source

pub fn tick_animation(&mut self)

Tick the animation frame (call on every tick for smooth animations)

Source

pub fn menu_up(&mut self)

Move menu selection up

Source

pub fn menu_down(&mut self)

Move menu selection down

Source

pub fn start_scan(&mut self)

Start scanning based on current mode

Source

pub fn check_scan_progress(&mut self)

Check for scan updates (call this on tick)

Source

pub fn select_up(&mut self)

Move selection up

Source

pub fn select_down(&mut self)

Move selection down

Source

pub fn page_up(&mut self, page_size: usize)

Page up

Source

pub fn page_down(&mut self, page_size: usize)

Page down

Source

pub fn go_top(&mut self)

Go to top

Source

pub fn go_bottom(&mut self)

Go to bottom

Source

pub fn ensure_visible_with_height(&mut self, viewport_height: usize)

Ensure selected item is visible with viewport height

Source

pub fn toggle_select(&mut self)

Toggle selection of current item

Source

pub fn toggle_expand(&mut self)

Toggle expanded state of current item

Source

pub fn expand(&mut self)

Expand current item (right arrow)

Source

pub fn collapse(&mut self)

Collapse current item (left arrow)

Source

pub fn scroll_up(&mut self)

Scroll up by one item

Source

pub fn scroll_down(&mut self)

Scroll down by one item

Source

pub fn select_all(&mut self)

Select all visible items

Source

pub fn deselect_all(&mut self)

Deselect all items

Source

pub fn visible_projects(&self) -> Vec<&ProjectEntry>

Get visible projects

Source

pub fn visible_count(&self) -> usize

Count visible projects

Source

pub fn selected_projects(&self) -> Vec<&ProjectEntry>

Get selected projects

Source

pub fn selected_size(&self) -> u64

Get total selected size

Source

pub fn selected_count(&self) -> usize

Get number of selected items

Source

pub fn filter_by_tab(&mut self)

Filter projects by current tab

Source

pub fn next_tab(&mut self)

Switch to next tab

Source

pub fn prev_tab(&mut self)

Switch to previous tab

Source

pub fn toggle_help(&mut self)

Toggle help

Enter search mode

Exit search mode

Source

pub fn search_push(&mut self, c: char)

Add character to search query

Source

pub fn search_pop(&mut self)

Remove last character from search query

Source

pub fn current_project(&self) -> Option<&ProjectEntry>

Get current project (selected)

Source

pub fn is_expanded(&self, visible_index: usize) -> bool

Is project expanded

Source

pub fn request_delete(&mut self)

Request deletion confirmation

Source

pub fn cancel_delete(&mut self)

Cancel deletion

Source

pub fn start_delete(&mut self)

Start deletion - collects paths and sets Cleaning state Actual deletion happens on next tick to allow UI to render

Source

pub fn has_pending_delete(&self) -> bool

Check if we have pending deletions to process

Source

pub fn take_pending_delete_items(&mut self) -> Vec<(PathBuf, Option<String>)>

Take pending delete items (clears them)

Source

pub fn deletion_complete( &mut self, success_count: usize, fail_count: usize, freed: u64, )

Mark deletion complete

Source

pub fn go_back(&mut self)

Go back to menu

Trait Implementations§

Source§

impl Default for App

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl !Sync for App

§

impl Unpin for App

§

impl UnwindSafe for App

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.