tui_lipan/widgets/file_tree/events.rs
1use super::fs::FileKind;
2use std::sync::Arc;
3
4/// File selection event emitted by `FileTree`.
5#[derive(Clone, Debug, PartialEq, Eq)]
6pub struct FileTreeEvent {
7 /// Full path of selected entry.
8 pub path: Arc<str>,
9 /// Kind of selected entry.
10 pub kind: FileKind,
11}
12
13/// File expand/collapse event emitted by `FileTree`.
14#[derive(Clone, Debug, PartialEq, Eq)]
15pub struct FileTreeToggleEvent {
16 /// Full path of toggled entry.
17 pub path: Arc<str>,
18 /// Kind of toggled entry.
19 pub kind: FileKind,
20 /// New expand state.
21 pub expanded: bool,
22}