pub struct VOXEL_COLLIDER_MANIFEST {
__private_field: (),
}
Fields§
§__private_field: ()
Methods from Deref<Target = AssetHandle<ShipSpec>>§
pub fn downcast_ref<T>(&self) -> Option<&Handle<T>>where
T: Storable,
pub fn downcast_ref<T>(&self) -> Option<&Handle<T>>where
T: Storable,
Returns a handle to the asset if it is of type T
.
pub fn read(&self) -> AssetReadGuard<'_, T>
pub fn read(&self) -> AssetReadGuard<'_, T>
Locks the pointed asset for reading.
If hot-reloading is disabled for T
or globally, no reloading can occur
so there is no actual lock. In these cases, calling this function does
not involve synchronisation.
Returns a RAII guard which will release the lock once dropped.
pub fn id(&self) -> &SharedString
pub fn id(&self) -> &SharedString
Returns the id of the asset.
pub fn as_untyped(&self) -> &Handle<dyn Any + Sync + Send>where
T: Storable,
pub fn as_untyped(&self) -> &Handle<dyn Any + Sync + Send>where
T: Storable,
Returns an untyped version of the handle.
pub fn strong(&self) -> ArcHandle<T>
pub fn strong(&self) -> ArcHandle<T>
Make a ArcHandle
that points to this handle.
pub fn weak(&self) -> WeakHandle<T>
pub fn weak(&self) -> WeakHandle<T>
Make a WeakHandle
that points to this handle.
pub fn strong_count(&self) -> usize
pub fn strong_count(&self) -> usize
Gets the number of strong ([ArcHandle
]) pointers to this allocation.
pub fn weak_count(&self) -> usize
pub fn weak_count(&self) -> usize
Gets the number of [WeakHandle
] pointers to this allocation.
pub fn reload_watcher(&self) -> ReloadWatcher<'_>
pub fn reload_watcher(&self) -> ReloadWatcher<'_>
Returns a ReloadWatcher
that can be used to check whether this asset
was reloaded.
§Example
use assets_manager::{AssetCache, ReloadWatcher};
let cache = AssetCache::new("assets")?;
let asset = cache.load::<String>("common.some_text")?;
let mut watcher = asset.reload_watcher();
// The handle has just been created, so `reloaded` returns false
assert!(!watcher.reloaded());
loop {
if watcher.reloaded() {
println!("The asset was reloaded !")
}
}
pub fn last_reload_id(&self) -> ReloadId
pub fn last_reload_id(&self) -> ReloadId
Returns the last ReloadId
associated with this asset.
It is only meaningful when compared to other ReloadId
s returned by the
same handle or to [ReloadId::NEVER
].
pub fn reloaded_global(&self) -> bool
pub fn reloaded_global(&self) -> bool
Returns true
if the asset has been reloaded since last call to this
method with any handle on this asset.
Note that this method and reload_watcher
are totally independant,
and the result of the two functions do not depend on whether the other
was called.
pub fn copied(&self) -> T
pub fn copied(&self) -> T
Returns a copy of the inner asset.
This is functionnally equivalent to cloned
, but it ensures that no
expensive operation is used (eg if a type is refactored).
pub fn cloned(&self) -> T
pub fn cloned(&self) -> T
Returns a clone of the inner asset.
Trait Implementations§
Source§impl Deref for VOXEL_COLLIDER_MANIFEST
impl Deref for VOXEL_COLLIDER_MANIFEST
impl LazyStatic for VOXEL_COLLIDER_MANIFEST
Auto Trait Implementations§
impl Freeze for VOXEL_COLLIDER_MANIFEST
impl RefUnwindSafe for VOXEL_COLLIDER_MANIFEST
impl Send for VOXEL_COLLIDER_MANIFEST
impl Sync for VOXEL_COLLIDER_MANIFEST
impl Unpin for VOXEL_COLLIDER_MANIFEST
impl UnwindSafe for VOXEL_COLLIDER_MANIFEST
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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