Struct veloren_common_assets::LoadFrom
pub struct LoadFrom<U, L>(PhantomData<(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>;
}
Tuple Fields§
§0: PhantomData<(U, L)>
Trait Implementations§
Auto Trait Implementations§
impl<U, L> RefUnwindSafe for LoadFrom<U, L>where
L: RefUnwindSafe,
U: RefUnwindSafe,
impl<U, L> Send for LoadFrom<U, L>
impl<U, L> Sync for LoadFrom<U, L>
impl<U, L> Unpin for LoadFrom<U, L>
impl<U, L> UnwindSafe for LoadFrom<U, L>where
L: UnwindSafe,
U: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more