Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/vfs/src/loader.rs')
| -rw-r--r-- | crates/vfs/src/loader.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/vfs/src/loader.rs b/crates/vfs/src/loader.rs index 3af91b1af8..f24354cb49 100644 --- a/crates/vfs/src/loader.rs +++ b/crates/vfs/src/loader.rs @@ -43,6 +43,13 @@ pub struct Config { pub watch: Vec<usize>, } +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub enum LoadingProgress { + Started, + Progress(usize), + Finished, +} + /// Message about an action taken by a [`Handle`]. pub enum Message { /// Indicate a gradual progress. @@ -52,7 +59,7 @@ pub enum Message { /// The total files to be loaded. n_total: usize, /// The files that have been loaded successfully. - n_done: Option<usize>, + n_done: LoadingProgress, /// The dir being loaded, `None` if its for a file. dir: Option<AbsPathBuf>, /// The [`Config`] version. @@ -65,7 +72,7 @@ pub enum Message { } /// Type that will receive [`Messages`](Message) from a [`Handle`]. -pub type Sender = Box<dyn Fn(Message) + Send>; +pub type Sender = crossbeam_channel::Sender<Message>; /// Interface for reading and watching files. pub trait Handle: fmt::Debug { |