pub struct AsyncTaskState {
pub id: Option<String>,
pub model: Option<String>,
pub request_id: Option<String>,
pub created: Option<u64>,
pub task_status: Option<TaskStatus>,
}Expand description
Status-only task result used while a task is pending or after it fails.
Chat, image, and video tasks share this wire shape, so it cannot be assigned to one media-specific variant until a result field is present.
Fields§
§id: Option<String>Task identifier, when supplied by the service.
model: Option<String>Model handling the task.
request_id: Option<String>Request identifier.
created: Option<u64>Creation time as a Unix timestamp in seconds, when supplied by the service while a task is still processing.
task_status: Option<TaskStatus>Current task status.
Implementations§
Source§impl AsyncTaskState
impl AsyncTaskState
Sourcepub const fn status(&self) -> Option<&TaskStatus>
pub const fn status(&self) -> Option<&TaskStatus>
Borrow the current task status.
Sourcepub fn is_processing(&self) -> bool
pub fn is_processing(&self) -> bool
Return whether the task is still processing.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Return whether the task completed successfully without a typed payload.
Trait Implementations§
Source§impl Clone for AsyncTaskState
impl Clone for AsyncTaskState
Source§fn clone(&self) -> AsyncTaskState
fn clone(&self) -> AsyncTaskState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AsyncTaskState
impl Debug for AsyncTaskState
Source§impl<'de> Deserialize<'de> for AsyncTaskState
impl<'de> Deserialize<'de> for AsyncTaskState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AsyncTaskState
impl RefUnwindSafe for AsyncTaskState
impl Send for AsyncTaskState
impl Sync for AsyncTaskState
impl Unpin for AsyncTaskState
impl UnsafeUnpin for AsyncTaskState
impl UnwindSafe for AsyncTaskState
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