Struct ResourceAcquireTask
pub struct ResourceAcquireTask(/* private fields */);Expand description
An opaque handle to a ResourceManager task.
Implementations§
§impl ResourceAcquireTask
impl ResourceAcquireTask
pub fn is_finished(&self) -> Result<bool, Error>
pub fn is_finished(&self) -> Result<bool, Error>
Tells whether the task has been finished and the callback called.
§Returns
true if the task has finished.
pub fn get_loaded_resource<T>(
&self,
url: impl AsRef<KanziStr>,
) -> Result<Option<T>, Error>where
T: MetaInherits<Resource>,
pub fn get_loaded_resource<T>(
&self,
url: impl AsRef<KanziStr>,
) -> Result<Option<T>, Error>where
T: MetaInherits<Resource>,
Gets a resource that has been loaded by this task. If the loading is not yet finished, or if the given URL has failed to load, returns a null pointer.
§Arguments
url- The URL of a resource in this load task.
§Returns
The loaded resource. If None is returned, the resource has not been successfully loaded
or the type cast failed.
pub fn get_loaded_resource_raw(
&self,
url: impl AsRef<KanziStr>,
) -> Result<Option<Resource>, Error>
pub fn get_loaded_resource_raw( &self, url: impl AsRef<KanziStr>, ) -> Result<Option<Resource>, Error>
Gets a resource that has been loaded by this task. If the loading is not yet finished, or if the given URL has failed to load, returns a null pointer.
§Arguments
url- The URL of a resource in this load task.
§Returns
The loaded resource. If None is returned, the resource has not been successfully loaded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResourceAcquireTask
impl RefUnwindSafe for ResourceAcquireTask
impl !Send for ResourceAcquireTask
impl !Sync for ResourceAcquireTask
impl Unpin for ResourceAcquireTask
impl UnwindSafe for ResourceAcquireTask
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more