[][src]Struct goods::Handle

pub struct Handle<A: Asset> { /* fields omitted */ }

Handle for an asset of type A that eventually resolves to the asset instance or an error.

Handle implements Future which helps with compound asset loading. Unlike many Futures Handle semantically is just a pointer to the place where asset isntance will be. So polling Handle isn't necessary for asset to be loaded. When asset is finally loaded any task that polled Handle will be notified.

Implementations

impl<A> Handle<A> where
    A: Asset
[src]

pub fn query(&self) -> Poll<&Result<A, Error<A>>>[src]

Queries for the asset state. Returns Poll::Ready(Ok(asset)) if asset was successfully loaded. Returns Poll::Ready(Err(error)) if error occured. Otherwise returns Poll::Pending if asset wasn't yet loaded.

pub fn get(&self) -> Option<&A>[src]

Returns asset instance if it's loaded.

Trait Implementations

impl<A: Clone + Asset> Clone for Handle<A>[src]

impl<A> Eq for Handle<A> where
    A: Asset
[src]

impl<A> Future for Handle<A> where
    A: Asset
[src]

type Output = Result<A, Error<A>>

The type of value produced on completion.

impl<A> Hash for Handle<A> where
    A: Asset
[src]

impl<A> PartialEq<Handle<A>> for Handle<A> where
    A: Asset
[src]

Auto Trait Implementations

impl<A> !RefUnwindSafe for Handle<A>

impl<A> Send for Handle<A>

impl<A> Sync for Handle<A>

impl<A> Unpin for Handle<A>

impl<A> !UnwindSafe for Handle<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<F, T, E> TryFuture for F where
    F: Future<Output = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

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.