pub struct AssetCache { /* private fields */ }Expand description
A cache for storing loaded game assets, keyed by URL.
Implementations§
Source§impl AssetCache
Implements cache query and management for AssetCache.
impl AssetCache
Implements cache query and management for AssetCache.
Sourcepub fn get_state(&self, url: &str) -> Option<AssetState>
pub fn get_state(&self, url: &str) -> Option<AssetState>
Sourcepub fn get_image(&self, url: &str) -> Option<HtmlImageElement>
pub fn get_image(&self, url: &str) -> Option<HtmlImageElement>
Sourcepub fn is_all_loaded(&self) -> bool
pub fn is_all_loaded(&self) -> bool
Returns true if all assets in the cache have finished loading.
§Returns
bool- True if no assets are in theLoadingstate.
Sourcepub fn loaded_count(&self) -> usize
pub fn loaded_count(&self) -> usize
Returns the number of assets that have been successfully loaded.
§Returns
usize- The count of loaded assets.
Source§impl AssetCache
impl AssetCache
Trait Implementations§
Source§impl Clone for AssetCache
impl Clone for AssetCache
Source§fn clone(&self) -> AssetCache
fn clone(&self) -> AssetCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AssetCache
impl Debug for AssetCache
Source§impl Default for AssetCache
Implements Default for AssetCache as a new empty cache.
impl Default for AssetCache
Implements Default for AssetCache as a new empty cache.
Source§fn default() -> AssetCache
fn default() -> AssetCache
Returns the “default value” for a type. Read more
Source§impl PartialEq for AssetCache
impl PartialEq for AssetCache
Source§fn eq(&self, other: &AssetCache) -> bool
fn eq(&self, other: &AssetCache) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AssetCache
Auto Trait Implementations§
impl Freeze for AssetCache
impl RefUnwindSafe for AssetCache
impl Send for AssetCache
impl Sync for AssetCache
impl Unpin for AssetCache
impl UnsafeUnpin for AssetCache
impl UnwindSafe for AssetCache
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