Enum bevy_asset::UntypedAssetId
source · pub enum UntypedAssetId {
Index {
type_id: TypeId,
index: AssetIndex,
},
Uuid {
type_id: TypeId,
uuid: Uuid,
},
}
Expand description
Variants§
Index
A small / efficient runtime identifier that can be used to efficiently look up an asset stored in Assets
. This is
the “default” identifier used for assets. The alternative(s) (ex: UntypedAssetId::Uuid
) will only be used if assets are
explicitly registered that way.
Uuid
A stable-across-runs / const asset identifier. This will only be used if an asset is explicitly registered in Assets
with one.
Implementations§
source§impl UntypedAssetId
impl UntypedAssetId
sourcepub fn typed_unchecked<A: Asset>(self) -> AssetId<A>
pub fn typed_unchecked<A: Asset>(self) -> AssetId<A>
Converts this to a “typed” AssetId
without checking the stored type to see if it matches the target A
Asset
type.
This should only be called if you are absolutely certain the asset type matches the stored type. And even then, you should
consider using UntypedAssetId::typed_debug_checked
instead.
sourcepub fn typed_debug_checked<A: Asset>(self) -> AssetId<A>
pub fn typed_debug_checked<A: Asset>(self) -> AssetId<A>
Trait Implementations§
source§impl Clone for UntypedAssetId
impl Clone for UntypedAssetId
source§fn clone(&self) -> UntypedAssetId
fn clone(&self) -> UntypedAssetId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for UntypedAssetId
impl Debug for UntypedAssetId
source§impl Display for UntypedAssetId
impl Display for UntypedAssetId
source§impl From<&UntypedHandle> for UntypedAssetId
impl From<&UntypedHandle> for UntypedAssetId
source§fn from(value: &UntypedHandle) -> Self
fn from(value: &UntypedHandle) -> Self
Converts to this type from the input type.
source§impl Hash for UntypedAssetId
impl Hash for UntypedAssetId
source§impl Ord for UntypedAssetId
impl Ord for UntypedAssetId
source§impl<A: Asset> PartialEq<AssetId<A>> for UntypedAssetId
impl<A: Asset> PartialEq<AssetId<A>> for UntypedAssetId
source§impl<A: Asset> PartialEq<UntypedAssetId> for AssetId<A>
impl<A: Asset> PartialEq<UntypedAssetId> for AssetId<A>
source§fn eq(&self, other: &UntypedAssetId) -> bool
fn eq(&self, other: &UntypedAssetId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for UntypedAssetId
impl PartialEq for UntypedAssetId
source§impl<A: Asset> PartialOrd<AssetId<A>> for UntypedAssetId
impl<A: Asset> PartialOrd<AssetId<A>> for UntypedAssetId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<A: Asset> PartialOrd<UntypedAssetId> for AssetId<A>
impl<A: Asset> PartialOrd<UntypedAssetId> for AssetId<A>
source§fn partial_cmp(&self, other: &UntypedAssetId) -> Option<Ordering>
fn partial_cmp(&self, other: &UntypedAssetId) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd for UntypedAssetId
impl PartialOrd for UntypedAssetId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<A: Asset> TryFrom<UntypedAssetId> for AssetId<A>
impl<A: Asset> TryFrom<UntypedAssetId> for AssetId<A>
§type Error = UntypedAssetIdConversionError
type Error = UntypedAssetIdConversionError
The type returned in the event of a conversion error.
impl Copy for UntypedAssetId
impl Eq for UntypedAssetId
Auto Trait Implementations§
impl Freeze for UntypedAssetId
impl RefUnwindSafe for UntypedAssetId
impl Send for UntypedAssetId
impl Sync for UntypedAssetId
impl Unpin for UntypedAssetId
impl UnwindSafe for UntypedAssetId
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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<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>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
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)
Convert
&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)
Convert
&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> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.