pub struct Handle<A: Asset> { /* private fields */ }Expand description
Cheap shared reference to a lazy resource; clones share success or failure.
Implementations§
Source§impl<A: Asset> Handle<A>
impl<A: Asset> Handle<A>
Sourcepub fn state(&self) -> AssetState<A>
pub fn state(&self) -> AssetState<A>
Current state without triggering a file read or decode.
This is a non-authoritative snapshot for polling and diagnostics: another thread may change
it immediately after the call. Handle::get is the only call that loads, and a Ready
or Failed state is sticky.
Sourcepub fn get(&self) -> Result<Arc<A>>
pub fn get(&self) -> Result<Arc<A>>
Resolves this handle synchronously, joining one concurrent decode. User decoder panics become sticky asset errors. Decoders must not recursively resolve the same handle. Returned resources are immutable.
Sourcepub fn get_with(&self, diagnostics: &RequestDiagnostics) -> Result<Arc<A>>
pub fn get_with(&self, diagnostics: &RequestDiagnostics) -> Result<Arc<A>>
Resolves into an explicit request sink, including when called on another thread.
Sourcepub fn source_name(&self) -> String
pub fn source_name(&self) -> String
Resource path or embedded key, suitable for diagnostic display.
Trait Implementations§
Auto Trait Implementations§
impl<A> !RefUnwindSafe for Handle<A>
impl<A> !UnwindSafe for Handle<A>
impl<A> Forget for Handle<A>
impl<A> Freeze for Handle<A>
impl<A> Move for Handle<A>
impl<A> Send for Handle<A>
impl<A> Sync for Handle<A>
impl<A> Unpin for Handle<A>
impl<A> UnsafeUnpin for Handle<A>where
Arc<Entry<A>>: UnsafeUnpin,
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