pub struct ProcessedAssets<T: 'static + Send + Sync> { /* private fields */ }Expand description
Storage for backend-processed (GPU) assets indexed by the same
RawAssetHandle as their source in Assets.
Populated by the asset sync system after a successful Asset::upload.
Implementations§
Source§impl<T: 'static + Send + Sync> ProcessedAssets<T>
impl<T: 'static + Send + Sync> ProcessedAssets<T>
pub fn new() -> Self
Sourcepub fn insert(&mut self, handle: RawAssetHandle, asset: T) -> Option<T>
pub fn insert(&mut self, handle: RawAssetHandle, asset: T) -> Option<T>
Store a processed asset, returning the previous value if one existed.
Sourcepub fn get(&self, handle: RawAssetHandle) -> Option<&T>
pub fn get(&self, handle: RawAssetHandle) -> Option<&T>
Look up a processed asset by handle.
Sourcepub fn get_mut(&mut self, handle: RawAssetHandle) -> Option<&mut T>
pub fn get_mut(&mut self, handle: RawAssetHandle) -> Option<&mut T>
Mutably look up a processed asset by handle.
Sourcepub fn remove(&mut self, handle: RawAssetHandle) -> Option<T>
pub fn remove(&mut self, handle: RawAssetHandle) -> Option<T>
Remove a processed asset by handle, returning the value if it existed.
Sourcepub fn contains(&self, handle: RawAssetHandle) -> bool
pub fn contains(&self, handle: RawAssetHandle) -> bool
Returns true if a processed asset exists for handle.
Sourcepub fn iter(&self) -> impl Iterator<Item = (RawAssetHandle, &T)>
pub fn iter(&self) -> impl Iterator<Item = (RawAssetHandle, &T)>
Iterate over all processed assets by handle.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = (RawAssetHandle, &mut T)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (RawAssetHandle, &mut T)>
Mutably iterate over all processed assets by handle.
pub fn get_by_name(&self, name: &str) -> Option<&T>
Trait Implementations§
Source§impl<'a, T: 'static + Send + Sync> IntoIterator for &'a ProcessedAssets<T>
impl<'a, T: 'static + Send + Sync> IntoIterator for &'a ProcessedAssets<T>
Source§impl<'a, T: 'static + Send + Sync> IntoIterator for &'a mut ProcessedAssets<T>
impl<'a, T: 'static + Send + Sync> IntoIterator for &'a mut ProcessedAssets<T>
Auto Trait Implementations§
impl<T> Freeze for ProcessedAssets<T>
impl<T> RefUnwindSafe for ProcessedAssets<T>where
T: RefUnwindSafe,
impl<T> Send for ProcessedAssets<T>
impl<T> Sync for ProcessedAssets<T>
impl<T> Unpin for ProcessedAssets<T>where
T: Unpin,
impl<T> UnsafeUnpin for ProcessedAssets<T>
impl<T> UnwindSafe for ProcessedAssets<T>where
T: UnwindSafe,
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