pub enum AsyncTaskResult {
Chat(AsyncChatTaskResult),
Video(AsyncVideoTaskResult),
Image(AsyncImageTaskResult),
State(AsyncTaskState),
}Expand description
Closed set of payloads returned by the asynchronous result endpoint.
Variants§
Chat(AsyncChatTaskResult)
Completed chat-completion payload.
Video(AsyncVideoTaskResult)
Completed video-generation payload.
Image(AsyncImageTaskResult)
Completed image-generation payload.
State(AsyncTaskState)
Shared status-only payload for pending, failed, or result-less tasks.
Implementations§
Source§impl AsyncTaskResult
impl AsyncTaskResult
Sourcepub const fn status(&self) -> Option<&TaskStatus>
pub const fn status(&self) -> Option<&TaskStatus>
Borrow the status supplied by media and status-only payloads.
Sourcepub const fn as_chat(&self) -> Option<&AsyncChatTaskResult>
pub const fn as_chat(&self) -> Option<&AsyncChatTaskResult>
Borrow the chat payload when this is a completed chat task.
Sourcepub const fn as_video(&self) -> Option<&AsyncVideoTaskResult>
pub const fn as_video(&self) -> Option<&AsyncVideoTaskResult>
Borrow the video payload when this is a completed video task.
Sourcepub const fn as_image(&self) -> Option<&AsyncImageTaskResult>
pub const fn as_image(&self) -> Option<&AsyncImageTaskResult>
Borrow the image payload when this is a completed image task.
Sourcepub const fn as_state(&self) -> Option<&AsyncTaskState>
pub const fn as_state(&self) -> Option<&AsyncTaskState>
Borrow the status-only payload.
Trait Implementations§
Source§impl Clone for AsyncTaskResult
impl Clone for AsyncTaskResult
Source§fn clone(&self) -> AsyncTaskResult
fn clone(&self) -> AsyncTaskResult
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 AsyncTaskResult
impl Debug for AsyncTaskResult
Source§impl<'de> Deserialize<'de> for AsyncTaskResult
impl<'de> Deserialize<'de> for AsyncTaskResult
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 AsyncTaskResult
impl RefUnwindSafe for AsyncTaskResult
impl Send for AsyncTaskResult
impl Sync for AsyncTaskResult
impl Unpin for AsyncTaskResult
impl UnsafeUnpin for AsyncTaskResult
impl UnwindSafe for AsyncTaskResult
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