pub struct AsyncResult {
pub task_id: String,
/* private fields */
}
Expand description
An AsyncResult
is a handle for the result of a task.
Fields§
§task_id: String
Implementations§
Source§impl AsyncResult
impl AsyncResult
pub fn new(task_id: &str) -> Self
Sourcepub async fn state(&self) -> Result<TaskState, BackendError>
pub async fn state(&self) -> Result<TaskState, BackendError>
Returns the current backend state for this task.
Sourcepub async fn ready(&self) -> Result<bool, BackendError>
pub async fn ready(&self) -> Result<bool, BackendError>
Returns whether the task finished successfully or failed.
Sourcepub async fn get<T>(&self, timeout: Option<Duration>) -> Result<T, BackendError>where
T: DeserializeOwned,
pub async fn get<T>(&self, timeout: Option<Duration>) -> Result<T, BackendError>where
T: DeserializeOwned,
Blocks until the task finishes and returns the result serialized as T
.
If timeout
is provided the method returns BackendError::Timeout
when the
interval elapses.
Trait Implementations§
Source§impl Clone for AsyncResult
impl Clone for AsyncResult
Source§fn clone(&self) -> AsyncResult
fn clone(&self) -> AsyncResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for AsyncResult
impl !RefUnwindSafe for AsyncResult
impl Send for AsyncResult
impl Sync for AsyncResult
impl Unpin for AsyncResult
impl !UnwindSafe for AsyncResult
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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