Hook

Enum Hook 

Source
pub enum Hook {
Show 25 variants OnNavigate { from: PathBuf, to: PathBuf, }, OnDrillDown { path: PathBuf, }, OnBack { from: PathBuf, to: PathBuf, }, OnScanStart { path: PathBuf, }, OnScanProgress { files_scanned: u64, dirs_scanned: u64, bytes_scanned: u64, }, OnScanComplete { path: PathBuf, total_files: u64, total_dirs: u64, total_size: u64, }, OnScanError { path: PathBuf, error: String, }, OnDeleteStart { items: Vec<PathBuf>, use_trash: bool, }, OnDeleteComplete { deleted: usize, failed: usize, bytes_freed: u64, }, OnCopyStart { sources: Vec<PathBuf>, destination: PathBuf, }, OnCopyComplete { succeeded: usize, failed: usize, bytes_copied: u64, }, OnMoveStart { sources: Vec<PathBuf>, destination: PathBuf, }, OnMoveComplete { succeeded: usize, failed: usize, }, OnRenameStart { source: PathBuf, new_name: String, }, OnRenameComplete { source: PathBuf, new_path: PathBuf, }, OnDuplicatesFound { group_count: usize, wasted_bytes: u64, }, OnAgeAnalysisComplete { stale_dirs: usize, oldest_age_secs: u64, }, OnRender { view: String, width: u16, height: u16, }, OnAction { action: String, }, OnModeChange { from: String, to: String, }, OnSelectionChange { selected: Vec<PathBuf>, count: usize, }, OnStartup, OnShutdown, OnPluginLoad { name: String, }, OnPluginUnload { name: String, },
}
Expand description

Events that plugins can hook into.

Variants§

§

OnNavigate

Fired when navigating to a new directory.

Fields

§from: PathBuf

Previous directory path.

§to: PathBuf

New directory path.

§

OnDrillDown

Fired when drilling down into a directory.

Fields

§path: PathBuf

Directory being entered.

§

OnBack

Fired when navigating back.

Fields

§from: PathBuf

Directory being left.

§to: PathBuf

Directory being returned to.

§

OnScanStart

Fired when a scan operation starts.

Fields

§path: PathBuf

Root path being scanned.

§

OnScanProgress

Fired periodically during scanning with progress info.

Fields

§files_scanned: u64

Files scanned so far.

§dirs_scanned: u64

Directories scanned so far.

§bytes_scanned: u64

Bytes scanned so far.

§

OnScanComplete

Fired when scan completes successfully.

Fields

§path: PathBuf

Root path that was scanned.

§total_files: u64

Total files found.

§total_dirs: u64

Total directories found.

§total_size: u64

Total size in bytes.

§

OnScanError

Fired when scan fails.

Fields

§path: PathBuf

Root path that failed.

§error: String

Error message.

§

OnDeleteStart

Fired before deletion starts.

Fields

§items: Vec<PathBuf>

Items to be deleted.

§use_trash: bool

Whether using trash (recoverable).

§

OnDeleteComplete

Fired after deletion completes.

Fields

§deleted: usize

Number of items successfully deleted.

§failed: usize

Number of items that failed to delete.

§bytes_freed: u64

Total bytes freed.

§

OnCopyStart

Fired before copy operation starts.

Fields

§sources: Vec<PathBuf>

Source paths.

§destination: PathBuf

Destination directory.

§

OnCopyComplete

Fired after copy completes.

Fields

§succeeded: usize

Number of items successfully copied.

§failed: usize

Number of items that failed.

§bytes_copied: u64

Total bytes copied.

§

OnMoveStart

Fired before move operation starts.

Fields

§sources: Vec<PathBuf>

Source paths.

§destination: PathBuf

Destination directory.

§

OnMoveComplete

Fired after move completes.

Fields

§succeeded: usize

Number of items successfully moved.

§failed: usize

Number of items that failed.

§

OnRenameStart

Fired before rename operation.

Fields

§source: PathBuf

Original path.

§new_name: String

New name.

§

OnRenameComplete

Fired after rename completes.

Fields

§source: PathBuf

Original path.

§new_path: PathBuf

New path after rename.

§

OnDuplicatesFound

Fired when duplicate analysis completes.

Fields

§group_count: usize

Number of duplicate groups found.

§wasted_bytes: u64

Total wasted space in bytes.

§

OnAgeAnalysisComplete

Fired when age analysis completes.

Fields

§stale_dirs: usize

Number of stale directories found.

§oldest_age_secs: u64

Oldest file age in seconds.

§

OnRender

Fired before rendering a view.

Fields

§view: String

Current view name.

§width: u16

Render area dimensions.

§height: u16
§

OnAction

Fired when user performs an action.

Fields

§action: String

Action name (e.g., “delete”, “copy”, “move”).

§

OnModeChange

Fired when application mode changes.

Fields

§from: String

Previous mode.

§to: String

New mode.

§

OnSelectionChange

Fired when selection changes.

Fields

§selected: Vec<PathBuf>

Currently selected paths.

§count: usize

Number of items selected.

§

OnStartup

Fired when application starts.

§

OnShutdown

Fired when application is about to quit.

§

OnPluginLoad

Fired when a plugin is loaded.

Fields

§name: String

Name of the plugin being loaded.

§

OnPluginUnload

Fired when a plugin is unloaded.

Fields

§name: String

Name of the plugin being unloaded.

Implementations§

Source§

impl Hook

Source

pub fn name(&self) -> &'static str

Get the hook name as a string (for matching in plugins).

Source

pub fn is_lifecycle(&self) -> bool

Check if this is a lifecycle event (startup/shutdown).

Source

pub fn is_sync(&self) -> bool

Check if this hook should run synchronously (blocking).

Trait Implementations§

Source§

impl Clone for Hook

Source§

fn clone(&self) -> Hook

Returns a duplicate 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 Hook

Source§

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

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

impl<'de> Deserialize<'de> for Hook

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Hook

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Hook

§

impl RefUnwindSafe for Hook

§

impl Send for Hook

§

impl Sync for Hook

§

impl Unpin for Hook

§

impl UnwindSafe for Hook

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, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> MaybeSend for T
where T: Send,