Struct assets_manager::loader::LoadFrom
source · pub struct LoadFrom<U, L>(_);Expand description
Loads assets from another type.
An example case for this is to easily load wrapper types, which are needed when the wrapped type is defined in another crate.
Example
use assets_manager::{Asset, loader::{LoadFrom, ParseLoader}};
use std::net::IpAddr;
struct Ip(IpAddr);
impl From<IpAddr> for Ip {
fn from(ip: IpAddr) -> Ip {
Ip(ip)
}
}
impl Asset for Ip {
const EXTENSION: &'static str = "ip";
type Loader = LoadFrom<IpAddr, ParseLoader>;
}