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 status(&self) -> AssetStatus
pub fn status(&self) -> AssetStatus
Current state without triggering a file read or decode.
Sourcepub fn error(&self) -> Option<Arc<Error>>
pub fn error(&self) -> Option<Arc<Error>>
Sticky original diagnostic, without triggering loading.
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> 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