[][src]Struct assets_manager::AssetRefLock

pub struct AssetRefLock<'a, A> { /* fields omitted */ }

A lock on an asset.

The type parameter A represents type of the locked asset.

This structure wraps a RwLock, so assets can be written to be reloaded. As such, any number of read guard can exist at the same time, but none can exist while reloading an asset.

This is the structure you want to use to store a reference to an asset.

Methods

impl<'_, A> AssetRefLock<'_, A>[src]

pub fn read(&self) -> AssetRef<A>[src]

Locks the pointed asset for reading.

Returns a RAII guard which will release the lock once dropped.

pub fn ptr_eq(&self, other: &Self) -> bool[src]

Checks if the two assets refer to the same cache entry

Trait Implementations

impl<'_, A> Clone for AssetRefLock<'_, A>[src]

impl<'_, A> Copy for AssetRefLock<'_, A>[src]

impl<'_, A> Debug for AssetRefLock<'_, A> where
    A: Debug
[src]

impl<'_, A> Hash for AssetRefLock<'_, A> where
    A: Hash
[src]

Auto Trait Implementations

impl<'a, A> !RefUnwindSafe for AssetRefLock<'a, A>

impl<'a, A> Send for AssetRefLock<'a, A> where
    A: Send + Sync

impl<'a, A> Sync for AssetRefLock<'a, A> where
    A: Send + Sync

impl<'a, A> Unpin for AssetRefLock<'a, A>

impl<'a, A> !UnwindSafe for AssetRefLock<'a, A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.