pub enum UntypedHandle {
Strong(Arc<StrongHandle>),
Weak(UntypedAssetId),
}
Expand description
Variants§
Strong(Arc<StrongHandle>)
Weak(UntypedAssetId)
Implementations§
Source§impl UntypedHandle
impl UntypedHandle
Sourcepub fn id(&self) -> UntypedAssetId
pub fn id(&self) -> UntypedAssetId
Returns the UntypedAssetId
for the referenced asset.
Sourcepub fn path(&self) -> Option<&AssetPath<'static>>
pub fn path(&self) -> Option<&AssetPath<'static>>
Returns the path if this is (1) a strong handle and (2) the asset has a path
Sourcepub fn clone_weak(&self) -> UntypedHandle
pub fn clone_weak(&self) -> UntypedHandle
Creates an UntypedHandle::Weak
clone of this UntypedHandle
, which will not keep the referenced Asset
alive.
Sourcepub fn typed_unchecked<A: Asset>(self) -> Handle<A>
pub fn typed_unchecked<A: Asset>(self) -> Handle<A>
Converts to a typed Handle. This will not check if the target Handle type matches.
Sourcepub fn typed_debug_checked<A: Asset>(self) -> Handle<A>
pub fn typed_debug_checked<A: Asset>(self) -> Handle<A>
Converts to a typed Handle. This will check the type when compiled with debug asserts, but it will not check if the target Handle type matches in release builds. Use this as an optimization when you want some degree of validation at dev-time, but you are also very certain that the type actually matches.
Sourcepub fn typed<A: Asset>(self) -> Handle<A>
pub fn typed<A: Asset>(self) -> Handle<A>
Converts to a typed Handle. This will panic if the internal TypeId
does not match the given asset type A
Sourcepub fn try_typed<A: Asset>(
self,
) -> Result<Handle<A>, UntypedAssetConversionError>
pub fn try_typed<A: Asset>( self, ) -> Result<Handle<A>, UntypedAssetConversionError>
Converts to a typed Handle. This will panic if the internal TypeId
does not match the given asset type A
Sourcepub fn meta_transform(&self) -> Option<&MetaTransform>
pub fn meta_transform(&self) -> Option<&MetaTransform>
The “meta transform” for the strong handle. This will only be Some
if the handle is strong and there is a meta transform
associated with it.
Trait Implementations§
Source§impl Clone for UntypedHandle
impl Clone for UntypedHandle
Source§fn clone(&self) -> UntypedHandle
fn clone(&self) -> UntypedHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for UntypedHandle
impl Debug for UntypedHandle
Source§impl From<&UntypedHandle> for UntypedAssetId
impl From<&UntypedHandle> for UntypedAssetId
Source§fn from(value: &UntypedHandle) -> Self
fn from(value: &UntypedHandle) -> Self
Source§impl Hash for UntypedHandle
impl Hash for UntypedHandle
Source§impl PartialEq for UntypedHandle
impl PartialEq for UntypedHandle
Source§impl<A: Asset> PartialOrd<Handle<A>> for UntypedHandle
impl<A: Asset> PartialOrd<Handle<A>> for UntypedHandle
Source§impl<A: Asset> PartialOrd<UntypedHandle> for Handle<A>
impl<A: Asset> PartialOrd<UntypedHandle> for Handle<A>
Source§impl PartialOrd for UntypedHandle
impl PartialOrd for UntypedHandle
Source§impl<A: Asset> TryFrom<UntypedHandle> for Handle<A>
impl<A: Asset> TryFrom<UntypedHandle> for Handle<A>
Source§type Error = UntypedAssetConversionError
type Error = UntypedAssetConversionError
Source§impl VisitAssetDependencies for UntypedHandle
impl VisitAssetDependencies for UntypedHandle
fn visit_dependencies(&self, visit: &mut impl FnMut(UntypedAssetId))
impl Eq for UntypedHandle
Auto Trait Implementations§
impl Freeze for UntypedHandle
impl !RefUnwindSafe for UntypedHandle
impl Send for UntypedHandle
impl Sync for UntypedHandle
impl Unpin for UntypedHandle
impl !UnwindSafe for UntypedHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
. 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>
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)
&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> 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
key
and return true
if they are equal.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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more