Skip to main content

App

Struct App 

Source
pub struct App {
Show 18 fields pub comparison: DirectoryComparison, pub mode: AppMode, pub active_panel: usize, pub left_list_state: ListState, pub right_list_state: ListState, pub left_items: Vec<FileItem>, pub right_items: Vec<FileItem>, pub file_diff: String, pub filter_mode: FilterMode, pub is_refreshing: bool, pub refresh_progress: String, pub refresh_percentage: f64, pub left_scrollbar_state: ScrollbarState, pub right_scrollbar_state: ScrollbarState, pub viewport_height: u16, pub toolbar_area: Rect, pub copy_info: Option<CopyInfo>, pub delete_info: Option<DeleteInfo>, /* private fields */
}

Fields§

§comparison: DirectoryComparison§mode: AppMode§active_panel: usize§left_list_state: ListState§right_list_state: ListState§left_items: Vec<FileItem>§right_items: Vec<FileItem>§file_diff: String§filter_mode: FilterMode§is_refreshing: bool§refresh_progress: String§refresh_percentage: f64§left_scrollbar_state: ScrollbarState§right_scrollbar_state: ScrollbarState§viewport_height: u16§toolbar_area: Rect§copy_info: Option<CopyInfo>§delete_info: Option<DeleteInfo>

Implementations§

Source§

impl App

Source

pub fn new(comparison: DirectoryComparison) -> Self

Source

pub fn update_file_lists(&mut self)

Source

pub fn handle_mouse_click(&mut self, x: u16, y: u16)

Source

pub fn calculate_half_page(&self) -> i32

Source

pub fn get_selected_item(&self) -> Option<&FileItem>

Source

pub fn can_copy(&self) -> bool

Source

pub fn toggle_folder(&mut self)

Source

pub fn move_selection(&mut self, delta: i32)

Source

pub fn scroll_to_top(&mut self)

Source

pub fn scroll_to_bottom(&mut self)

Source

pub fn expand_all(&mut self)

Source

pub fn collapse_all(&mut self)

Source

pub fn start_refresh(&mut self)

Source

pub fn check_refresh_progress(&mut self)

Source

pub fn swap_panels(&mut self)

Source

pub fn prepare_copy(&mut self)

Source

pub fn execute_copy(&mut self) -> Result<()>

Source

pub fn cancel_copy(&mut self)

Source

pub fn can_delete(&self) -> bool

Source

pub fn prepare_delete(&mut self)

Source

pub fn execute_delete(&mut self) -> Result<()>

Source

pub fn cancel_delete(&mut self)

Source

pub fn handle_key_event(&mut self, key: KeyEvent) -> Result<bool>

Source

pub fn handle_mouse_event(&mut self, mouse: MouseEvent)

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl !Sync for App

§

impl Unpin for App

§

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