asset: implement Reflect for the ResourceManager
This commit is contained in:
parent
9fc3d1eaaa
commit
173d957f25
1 changed files with 8 additions and 2 deletions
|
@ -2,6 +2,7 @@ use std::{any::Any, collections::HashMap, path::Path, sync::{Arc, RwLock, RwLock
|
|||
|
||||
use async_std::task;
|
||||
use crossbeam::channel::Receiver;
|
||||
use lyra_reflect::Reflect;
|
||||
use notify::{Watcher, RecommendedWatcher};
|
||||
use notify_debouncer_full::{DebouncedEvent, FileIdMap};
|
||||
use thiserror::Error;
|
||||
|
@ -67,11 +68,16 @@ pub struct ResourceManagerState {
|
|||
watchers: HashMap<String, ResourceWatcher>,
|
||||
}
|
||||
|
||||
mod lyra_engine {
|
||||
pub use lyra_reflect as reflect;
|
||||
}
|
||||
|
||||
/// The ResourceManager
|
||||
///
|
||||
/// This exists since we need the manager to be `Send + Sync`.
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Reflect)]
|
||||
pub struct ResourceManager {
|
||||
#[reflect(skip)]
|
||||
inner: Arc<RwLock<ResourceManagerState>>,
|
||||
}
|
||||
|
||||
|
@ -522,4 +528,4 @@ pub mod tests {
|
|||
|
||||
assert!(event.iter().any(|ev| ev.kind.is_remove() || ev.kind.is_modify()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue