[][src]Struct quicksilver::lifecycle::Asset

pub struct Asset<T>(_);

A structure to manage the loading and use of a future

Methods

impl<T> Asset<T>[src]

pub fn new(
    future: impl Future<Item = T, Error = QuicksilverError> + 'static
) -> Asset<T>
[src]

Create a new asset from a future

pub fn execute(
    &mut self,
    loaded: impl FnOnce(&mut T) -> Result<()>
) -> Result<()>
[src]

Run a function if the loading is complete

pub fn execute_or(
    &mut self,
    loaded: impl FnOnce(&mut T) -> Result<()>,
    loading: impl FnOnce() -> Result<()>
) -> Result<()>
[src]

Run a function if the loading is complete, or a different function if it isn't

Auto Trait Implementations

impl<T> !Send for Asset<T>

impl<T> !Sync for Asset<T>

impl<T> Unpin for Asset<T> where
    T: Unpin

impl<T> !UnwindSafe for Asset<T>

impl<T> !RefUnwindSafe for Asset<T>

Blanket Implementations

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

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

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.

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

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

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

impl<T> SetParameter for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Downcast for T where
    T: Any