[−][src]Struct goods::Handle
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 Future
s 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]
A: Asset,
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]
A: Asset,
impl<A> Future for Handle<A> where
A: Asset,
[src]
A: Asset,
type Output = Result<A, Error<A>>
The type of value produced on completion.
fn poll(
self: Pin<&mut Self>,
context: &mut Context
) -> Poll<Result<A, Error<A>>>
[src]
self: Pin<&mut Self>,
context: &mut Context
) -> Poll<Result<A, Error<A>>>
impl<A> Hash for Handle<A> where
A: Asset,
[src]
A: Asset,
fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<A> PartialEq<Handle<A>> for Handle<A> where
A: Asset,
[src]
A: Asset,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<F, T, E> TryFuture for F where
F: Future<Output = Result<T, E>> + ?Sized,
[src]
F: Future<Output = Result<T, E>> + ?Sized,
type Ok = T
The type of successful values yielded by this future
type Error = E
The type of failures yielded by this future
fn try_poll(self: Pin<&mut F>, cx: &mut Context) -> Poll<<F as Future>::Output>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,