Enum bevy_internal::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>(self) -> AssetId<A>where
A: Asset,
pub fn typed_unchecked<A>(self) -> AssetId<A>where
A: Asset,
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>(self) -> AssetId<A>where
A: Asset,
pub fn typed_debug_checked<A>(self) -> AssetId<A>where
A: Asset,
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<A> From<&Handle<A>> for UntypedAssetIdwhere
A: Asset,
impl<A> From<&Handle<A>> for UntypedAssetIdwhere
A: Asset,
source§fn from(value: &Handle<A>) -> UntypedAssetId
fn from(value: &Handle<A>) -> UntypedAssetId
Converts to this type from the input type.
source§impl From<&UntypedHandle> for UntypedAssetId
impl From<&UntypedHandle> for UntypedAssetId
source§fn from(value: &UntypedHandle) -> UntypedAssetId
fn from(value: &UntypedHandle) -> UntypedAssetId
Converts to this type from the input type.
source§impl<A> From<AssetId<A>> for UntypedAssetIdwhere
A: Asset,
impl<A> From<AssetId<A>> for UntypedAssetIdwhere
A: Asset,
source§fn from(value: AssetId<A>) -> UntypedAssetId
fn from(value: AssetId<A>) -> UntypedAssetId
Converts to this type from the input type.
source§impl<A> From<Handle<A>> for UntypedAssetIdwhere
A: Asset,
impl<A> From<Handle<A>> for UntypedAssetIdwhere
A: Asset,
source§fn from(value: Handle<A>) -> UntypedAssetId
fn from(value: Handle<A>) -> UntypedAssetId
Converts to this type from the input type.
source§impl From<UntypedHandle> for UntypedAssetId
impl From<UntypedHandle> for UntypedAssetId
source§fn from(value: UntypedHandle) -> UntypedAssetId
fn from(value: UntypedHandle) -> UntypedAssetId
Converts to this type from the input type.
source§impl Hash for UntypedAssetId
impl Hash for UntypedAssetId
source§impl<A> PartialEq<AssetId<A>> for UntypedAssetIdwhere
A: Asset,
impl<A> PartialEq<AssetId<A>> for UntypedAssetIdwhere
A: Asset,
source§impl<A> PartialEq<UntypedAssetId> for AssetId<A>where
A: Asset,
impl<A> PartialEq<UntypedAssetId> for AssetId<A>where
A: Asset,
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§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<A> PartialOrd<AssetId<A>> for UntypedAssetIdwhere
A: Asset,
impl<A> PartialOrd<AssetId<A>> for UntypedAssetIdwhere
A: Asset,
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> PartialOrd<UntypedAssetId> for AssetId<A>where
A: Asset,
impl<A> PartialOrd<UntypedAssetId> for AssetId<A>where
A: Asset,
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
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<A> TryFrom<UntypedAssetId> for AssetId<A>where
A: Asset,
impl<A> TryFrom<UntypedAssetId> for AssetId<A>where
A: Asset,
§type Error = UntypedAssetIdConversionError
type Error = UntypedAssetIdConversionError
The type returned in the event of a conversion error.
source§fn try_from(
value: UntypedAssetId
) -> Result<AssetId<A>, <AssetId<A> as TryFrom<UntypedAssetId>>::Error>
fn try_from( value: UntypedAssetId ) -> Result<AssetId<A>, <AssetId<A> as TryFrom<UntypedAssetId>>::Error>
Performs the conversion.
impl Copy for UntypedAssetId
impl Eq for UntypedAssetId
Auto Trait Implementations§
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, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
Return the
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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<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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.