Enum amethyst_assets::AssetPrefab
source · pub enum AssetPrefab<A, F>where
A: Asset,
F: Format<A>,{
Handle(Handle<A>),
File(String, F, F::Options),
}
Expand description
Convenience PrefabData
for loading assets of type A
using Format
F
.
Will add a Handle<A>
to the Entity
Type parameters:
A
:Asset
,F
:Format
for loadingA
Variants
Handle(Handle<A>)
From existing handle
File(String, F, F::Options)
From file, (name, format, format options)
Trait Implementations
sourceimpl<A: Clone, F: Clone> Clone for AssetPrefab<A, F>where
A: Asset,
F: Format<A>,
F::Options: Clone,
impl<A: Clone, F: Clone> Clone for AssetPrefab<A, F>where
A: Asset,
F: Format<A>,
F::Options: Clone,
sourcefn clone(&self) -> AssetPrefab<A, F>
fn clone(&self) -> AssetPrefab<A, F>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'de, A, F> Deserialize<'de> for AssetPrefab<A, F>where
A: Asset,
F: Format<A>,
F: Deserialize<'de>,
F::Options: Deserialize<'de>,
impl<'de, A, F> Deserialize<'de> for AssetPrefab<A, F>where
A: Asset,
F: Format<A>,
F: Deserialize<'de>,
F::Options: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'a, A, F> PrefabData<'a> for AssetPrefab<A, F>where
A: Asset,
F: Format<A> + Clone,
F::Options: Clone,
impl<'a, A, F> PrefabData<'a> for AssetPrefab<A, F>where
A: Asset,
F: Format<A> + Clone,
F::Options: Clone,
type SystemData = (Read<'a, Loader, PanicHandler>, Storage<'a, Handle<A>, FetchMut<'a, MaskedStorage<Handle<A>>>>, Read<'a, AssetStorage<A>, DefaultProvider>)
type SystemData = (Read<'a, Loader, PanicHandler>, Storage<'a, Handle<A>, FetchMut<'a, MaskedStorage<Handle<A>>>>, Read<'a, AssetStorage<A>, DefaultProvider>)
SystemData
needed to perform the loadsourcefn add_to_entity(
&self,
entity: Entity,
system_data: &mut Self::SystemData,
_: &[Entity]
) -> Result<Handle<A>, PrefabError>
fn add_to_entity(
&self,
entity: Entity,
system_data: &mut Self::SystemData,
_: &[Entity]
) -> Result<Handle<A>, PrefabError>
Add the data for this prefab onto the given
Entity
Read moresourcefn load_sub_assets(
&mut self,
progress: &mut ProgressCounter,
system_data: &mut Self::SystemData
) -> Result<bool, PrefabError>
fn load_sub_assets(
&mut self,
progress: &mut ProgressCounter,
system_data: &mut Self::SystemData
) -> Result<bool, PrefabError>
Trigger asset loading for any sub assets. Read more
Auto Trait Implementations
impl<A, F> RefUnwindSafe for AssetPrefab<A, F>where
A: RefUnwindSafe,
F: RefUnwindSafe,
<F as Format<A>>::Options: RefUnwindSafe,
impl<A, F> Send for AssetPrefab<A, F>
impl<A, F> Sync for AssetPrefab<A, F>where
F: Sync,
<F as Format<A>>::Options: Sync,
impl<A, F> Unpin for AssetPrefab<A, F>where
A: Unpin,
F: Unpin,
<F as Format<A>>::Options: Unpin,
impl<A, F> UnwindSafe for AssetPrefab<A, F>where
A: UnwindSafe,
F: UnwindSafe,
<F as Format<A>>::Options: UnwindSafe,
Blanket Implementations
impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.