Skip to main content

State

Struct State 

Source
pub struct State {
Show 21 fields pub now: SystemTime, pub all: Vec<Cache>, pub sort: Sort, pub marks: MarkSet, pub cursor: usize, pub files_cursor: usize, pub floor: FloorPolicy, pub focus_right: bool, pub stack: Vec<Vec<Cache>>, pub stack_labels: Vec<String>, pub quit: bool, pub modal: Modal, pub dry_run: bool, pub yes_mode: bool, pub total_freed: u64, pub filter: Option<Filter>, pub loading: Option<Loading>, pub overlay: Option<Overlay>, pub level_dirty: bool, pub drill_paths: Vec<PathBuf>, pub cursor_stack: Vec<usize>,
}

Fields§

§now: SystemTime§all: Vec<Cache>§sort: Sort§marks: MarkSet§cursor: usize§files_cursor: usize§floor: FloorPolicy§focus_right: bool§stack: Vec<Vec<Cache>>§stack_labels: Vec<String>§quit: bool§modal: Modal§dry_run: bool§yes_mode: bool§total_freed: u64

Bytes freed across all deletion passes in this session.

§filter: Option<Filter>

When Some, a less/vim-style / filter is active (possibly being edited). When None, no filter is applied.

§loading: Option<Loading>

Some while a background drill-in scan is running; drives the spinner modal.

§overlay: Option<Overlay>

Some for ~2 s after a delete pass completes; draws the result overlay until Msg::OverlayDismiss is received.

§level_dirty: bool

Set to true whenever something was successfully deleted at the current drill level. Reset on drill in/out. When we drill out and this was true, the parent’s row for the cache we’re leaving is re-scanned to reflect the smaller size.

§drill_paths: Vec<PathBuf>

Path stack parallel to stack so we know which entry in the restored parent corresponds to the cache we just drilled out of. Pushed on drill_into, popped on drill_out.

§cursor_stack: Vec<usize>

Cursor positions parallel to stack. On drill_into we save the current cursor; on drill_out we restore it (then clamp), so the user lands back on the row they were on instead of at the top.

Implementations§

Source§

impl State

Source

pub fn sorted_indices(&self) -> Vec<usize>

Source

pub fn drill_into(&mut self, children: Vec<Cache>)

Source

pub fn drill_out(&mut self)

Source

pub fn drill_out_with_path(&mut self) -> Option<PathBuf>

Same as drill_out but also returns the path of the cache we just left (for the event loop to trigger a refresh). Returns None when already at the top level.

Auto Trait Implementations§

§

impl Freeze for State

§

impl RefUnwindSafe for State

§

impl Send for State

§

impl Sync for State

§

impl Unpin for State

§

impl UnsafeUnpin for State

§

impl UnwindSafe for State

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.