pub struct TransformedSubAsset<'a, A: Asset> { /* private fields */ }Expand description
A labeled sub-asset of TransformedAsset
Implementations§
Source§impl<'a, A: Asset> TransformedSubAsset<'a, A>
impl<'a, A: Asset> TransformedSubAsset<'a, A>
Sourcepub fn from_loaded(asset: &'a mut ErasedLoadedAsset) -> Option<Self>
pub fn from_loaded(asset: &'a mut ErasedLoadedAsset) -> Option<Self>
Creates a new TransformedSubAsset from asset if its internal value matches A.
Sourcepub fn get_labeled<B: Asset, Q>(
&mut self,
label: &Q,
) -> Option<TransformedSubAsset<'_, B>>
pub fn get_labeled<B: Asset, Q>( &mut self, label: &Q, ) -> Option<TransformedSubAsset<'_, B>>
Returns the labeled asset, if it exists and matches this type.
Sourcepub fn get_erased_labeled<Q>(&self, label: &Q) -> Option<&ErasedLoadedAsset>
pub fn get_erased_labeled<Q>(&self, label: &Q) -> Option<&ErasedLoadedAsset>
Returns the type-erased labeled asset, if it exists.
Sourcepub fn get_labeled_by_id<B: Asset>(
&mut self,
id: impl Into<AssetId<B>>,
) -> Option<TransformedSubAsset<'_, B>>
pub fn get_labeled_by_id<B: Asset>( &mut self, id: impl Into<AssetId<B>>, ) -> Option<TransformedSubAsset<'_, B>>
Returns the labeled asset given its asset ID if it exists and matches the type.
This can be used to get the asset from its handle since &Handle implements
Into<AssetId<B>>.
Sourcepub fn get_erased_labeled_by_id(
&self,
id: impl Into<UntypedAssetId>,
) -> Option<&ErasedLoadedAsset>
pub fn get_erased_labeled_by_id( &self, id: impl Into<UntypedAssetId>, ) -> Option<&ErasedLoadedAsset>
Returns the type-erased labeled asset given its asset ID if it exists.
This can be used to get the asset from its handle since &UntypedHandle implements
Into<UntypedAssetId>.
Sourcepub fn get_untyped_handle<Q>(&self, label: &Q) -> Option<UntypedHandle>
pub fn get_untyped_handle<Q>(&self, label: &Q) -> Option<UntypedHandle>
Returns the UntypedHandle of the labeled asset with the provided ‘label’, if it exists.
Sourcepub fn get_handle<Q, B: Asset>(&self, label: &Q) -> Option<Handle<B>>
pub fn get_handle<Q, B: Asset>(&self, label: &Q) -> Option<Handle<B>>
Returns the Handle of the labeled asset with the provided ‘label’, if it exists and is an asset of type B
Sourcepub fn insert_labeled(
&mut self,
label: impl Into<CowArc<'static, str>>,
handle: impl Into<UntypedHandle>,
asset: impl Into<ErasedLoadedAsset>,
)
pub fn insert_labeled( &mut self, label: impl Into<CowArc<'static, str>>, handle: impl Into<UntypedHandle>, asset: impl Into<ErasedLoadedAsset>, )
Adds asset as a labeled sub asset using label and handle
Sourcepub fn iter_labels(&self) -> impl Iterator<Item = &str>
pub fn iter_labels(&self) -> impl Iterator<Item = &str>
Iterate over all labels for “labeled assets” in the loaded asset
Trait Implementations§
Source§impl<'a, A: Asset> Deref for TransformedSubAsset<'a, A>
impl<'a, A: Asset> Deref for TransformedSubAsset<'a, A>
Auto Trait Implementations§
impl<'a, A> !RefUnwindSafe for TransformedSubAsset<'a, A>
impl<'a, A> !UnwindSafe for TransformedSubAsset<'a, A>
impl<'a, A> Freeze for TransformedSubAsset<'a, A>
impl<'a, A> Send for TransformedSubAsset<'a, A>
impl<'a, A> Sync for TransformedSubAsset<'a, A>
impl<'a, A> Unpin for TransformedSubAsset<'a, A>
impl<'a, A> UnsafeUnpin for TransformedSubAsset<'a, A>
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
impl<T> ConditionalSend for Twhere
T: Send,
impl<R> CryptoRng for R
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
impl<R> RngCore for Rwhere
R: Rng,
Source§impl<R> RngExt for R
impl<R> RngExt for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
numerator/denominator of being
true. Read more