Struct assets_manager::AssetReadGuard

source ·
pub struct AssetReadGuard<'a, T: ?Sized> { /* private fields */ }
Expand description

RAII guard used to keep a read lock on an asset and release it when dropped.

This type is a smart pointer to type T.

It can be obtained by calling Handle::read.

Implementations§

source§

impl<'a, T: ?Sized> AssetReadGuard<'a, T>

source

pub fn map<U: ?Sized, F>(this: Self, f: F) -> AssetReadGuard<'a, U>
where F: FnOnce(&T) -> &U,

Make a new AssetReadGuard for a component of the locked data.

source

pub fn try_map<U: ?Sized, F>( this: Self, f: F ) -> Result<AssetReadGuard<'a, U>, Self>
where F: FnOnce(&T) -> Option<&U>,

Attempts to make a new AssetReadGuard for a component of the locked data.

Returns the original guard if the closure returns None.

source§

impl<'a> AssetReadGuard<'a, dyn Any>

source

pub fn downcast<T: Any>(self) -> Result<AssetReadGuard<'a, T>, Self>

Attempt to downcast the guard to a concrete type.

source§

impl<'a> AssetReadGuard<'a, dyn Any + Send>

source

pub fn downcast<T: Any>(self) -> Result<AssetReadGuard<'a, T>, Self>

Attempt to downcast the guard to a concrete type.

source§

impl<'a> AssetReadGuard<'a, dyn Any + Send + Sync>

source

pub fn downcast<T: Any>(self) -> Result<AssetReadGuard<'a, T>, Self>

Attempt to downcast the guard to a concrete type.

Trait Implementations§

source§

impl<T, U> AsRef<U> for AssetReadGuard<'_, T>
where T: AsRef<U> + ?Sized,

source§

fn as_ref(&self) -> &U

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> Debug for AssetReadGuard<'_, T>
where T: Debug + ?Sized,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: ?Sized> Deref for AssetReadGuard<'_, T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<T> Display for AssetReadGuard<'_, T>
where T: Display + ?Sized,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, T> Freeze for AssetReadGuard<'a, T>
where T: ?Sized,

§

impl<'a, T> !RefUnwindSafe for AssetReadGuard<'a, T>

§

impl<'a, T> !Send for AssetReadGuard<'a, T>

§

impl<'a, T> Sync for AssetReadGuard<'a, T>
where T: Sync + ?Sized,

§

impl<'a, T> Unpin for AssetReadGuard<'a, T>
where T: ?Sized,

§

impl<'a, T> !UnwindSafe for AssetReadGuard<'a, T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<S> FromSample<S> for S

source§

fn from_sample_(s: S) -> S

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

source§

fn to_sample_(self) -> U

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,