[−][src]Trait warmy::load::Load
Class of types that can be loaded and reloaded.
The first type variable, C
, represents the context of the loading. This will be accessed via
a mutable reference when loading and reloading.
The second type variable, K
, is the type of key that can be used to index resources. Some
special resource keys exist:
SimpleKey
: such a key indexes a resource that lives either on the filesystem or as a logical resource (in-memory, on-the-fly, etc.)
A key type must implement the Key
trait in order to be usable.
The last type variable, Method
, is a tag-only value that is useful to implement several
algorithms to load the same type with different methods.
Associated Types
Loading content...Required methods
Loading content...Provided methods
fn reload(
&self,
key: K,
storage: &mut Storage<C, K>,
ctx: &mut C
) -> Result<Self, Self::Error>
&self,
key: K,
storage: &mut Storage<C, K>,
ctx: &mut C
) -> Result<Self, Self::Error>
Function called when a resource must be reloaded.
The default implementation of that function calls Load::load
and returns its result.
Implementors
impl<C, K, T> Load<C, K, Json> for T where
K: Key + Into<Option<PathBuf>>,
T: 'static + for<'de> Deserialize<'de>,
[src]
K: Key + Into<Option<PathBuf>>,
T: 'static + for<'de> Deserialize<'de>,
type Error = JsonError
fn load(
key: K,
_: &mut Storage<C, K>,
_: &mut C
) -> Result<Loaded<Self, K>, Self::Error>
[src]
key: K,
_: &mut Storage<C, K>,
_: &mut C
) -> Result<Loaded<Self, K>, Self::Error>
impl<C, K, T> Load<C, K, Ron> for T where
K: Key + Into<Option<PathBuf>>,
T: 'static + for<'de> Deserialize<'de>,
[src]
K: Key + Into<Option<PathBuf>>,
T: 'static + for<'de> Deserialize<'de>,
type Error = RonError
fn load(
key: K,
_: &mut Storage<C, K>,
_: &mut C
) -> Result<Loaded<Self, K>, Self::Error>
[src]
key: K,
_: &mut Storage<C, K>,
_: &mut C
) -> Result<Loaded<Self, K>, Self::Error>
impl<C, K, T> Load<C, K, Toml> for T where
K: Key + Into<Option<PathBuf>>,
T: 'static + for<'de> Deserialize<'de>,
[src]
K: Key + Into<Option<PathBuf>>,
T: 'static + for<'de> Deserialize<'de>,