furmint-resources 0.1.0

Resources abstractions for `furmint`
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::ResourceResult;
use std::any::Any;
use std::fmt::Debug;
use std::io::Read;

/// Asset trait
pub trait Asset: Any + Send + Sync + 'static + Debug {}
impl<T: Any + Send + Sync + 'static + Debug> Asset for T {}

/// Asset loader trait
pub trait ErasedAssetLoader: Send + Sync + Debug {
    /// Load the asset
    fn load_erased(&self, reader: &mut dyn Read) -> ResourceResult<Box<dyn Any + Send + Sync>>;
}