Skip to main content

furmint_resources/
loader.rs

1use crate::ResourceResult;
2use std::any::Any;
3use std::fmt::Debug;
4use std::io::Read;
5
6/// Asset trait
7pub trait Asset: Any + Send + Sync + 'static + Debug {}
8impl<T: Any + Send + Sync + 'static + Debug> Asset for T {}
9
10/// Asset loader trait
11pub trait ErasedAssetLoader: Send + Sync + Debug {
12    /// Load the asset
13    fn load_erased(&self, reader: &mut dyn Read) -> ResourceResult<Box<dyn Any + Send + Sync>>;
14}