[][src]Struct amethyst_assets::AssetLoaderSystemData

pub struct AssetLoaderSystemData<'a, A> where
    A: Asset
{ /* fields omitted */ }

Helper type for loading assets

Methods

impl<'a, A> AssetLoaderSystemData<'a, A> where
    A: Asset
[src]

pub fn load<F, N, P>(&self, name: N, format: F, progress: P) -> Handle<A> where
    F: Format<A::Data>,
    N: Into<String>,
    P: Progress
[src]

Loads an asset with a given format from the default (directory) source. If you want to load from a custom source instead, use load_from.

See load_from for more information.

pub fn load_from<F, N, P, S: ?Sized>(
    &self,
    name: N,
    format: F,
    source: &S,
    progress: P
) -> Handle<A> where
    F: Format<A::Data>,
    N: Into<String>,
    P: Progress,
    S: AsRef<str> + Eq + Hash,
    String: Borrow<S>, 
[src]

Loads an asset with a given id and format from a custom source. The actual work is done in a worker thread, thus this method immediately returns a handle.

Parameters

  • name: this is just an identifier for the asset, most likely a file name e.g. "meshes/a.obj"
  • format: A format struct which loads bytes from a source and produces Asset::Data with them
  • source: An identifier for a source which has previously been added using with_source
  • progress: A tracker which will be notified of assets which have been imported

pub fn load_from_data<P>(&self, data: A::Data, progress: P) -> Handle<A> where
    A: Asset,
    P: Progress
[src]

Load an asset from data and return a handle.

pub fn load_from_data_async<P, F>(&self, data: F, progress: P) -> Handle<A> where
    A: Asset,
    P: Progress,
    F: FnOnce() -> A::Data + Send + Sync + 'static, 
[src]

Asynchronously load an asset from data and return a handle.

Trait Implementations

impl<'a, A> SystemData<'a> for AssetLoaderSystemData<'a, A> where
    A: Asset,
    ReadExpect<'a, Loader>: SystemData<'a>,
    Read<'a, AssetStorage<A>>: SystemData<'a>, 
[src]

Auto Trait Implementations

impl<'a, A> Unpin for AssetLoaderSystemData<'a, A>

impl<'a, A> Sync for AssetLoaderSystemData<'a, A> where
    <A as Asset>::Data: Send

impl<'a, A> Send for AssetLoaderSystemData<'a, A> where
    <A as Asset>::Data: Send

impl<'a, A> !UnwindSafe for AssetLoaderSystemData<'a, A>

impl<'a, A> !RefUnwindSafe for AssetLoaderSystemData<'a, A>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<'a, T> DynamicSystemData<'a> for T where
    T: SystemData<'a>, 
[src]

type Accessor = StaticAccessor<T>

The accessor of the SystemData, which specifies the read and write dependencies and does the fetching. Read more

impl<T> Resource for T where
    T: Any + Send + Sync
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 
[src]

impl<T> Erased for T[src]