pub struct TaskResult {
pub meta: ResponseMeta,
pub status: TaskStatus,
pub task_id: Option<String>,
pub solution: Solution,
}Expand description
Response returned by task result queries and synchronous task creation.
Fields§
§meta: ResponseMetaShared response metadata.
status: TaskStatusCurrent task status.
This field is required. The service may omit status on request-level
failures such as an invalid key or an unknown task ID, but those carry
an error envelope that is rejected before this type is decoded. A
success envelope without a status therefore violates the API contract,
and reporting it as Error::UnexpectedResponse with the raw body is
more useful than silently substituting a placeholder status.
task_id: Option<String>Identifier assigned by the synchronous task endpoint.
/createSyncTask returns one on both the success and the failure path;
/getTaskResult does not echo it back, so this is None there.
The name is spelled out because this struct has no rename_all: the
other fields already match the wire, and a blanket rule would have to be
re-checked against every one of them.
solution: SolutionRaw task solution, preserving a missing field separately from JSON null.
Implementations§
Source§impl TaskResult
impl TaskResult
Sourcepub fn is_processing(&self) -> bool
pub fn is_processing(&self) -> bool
Returns true when the task is still processing.
Sourcepub fn deserialize_solution<T>(&self) -> Result<T>where
T: DeserializeOwned,
pub fn deserialize_solution<T>(&self) -> Result<T>where
T: DeserializeOwned,
Deserializes the raw solution into a caller-selected type.