pub struct ProcessorResponse {
pub resource_id: Option<i32>,
pub additional_resource_id: Option<i32>,
pub resource: Option<HashMap<String, Value>>,
pub error: Option<Value>,
pub additional_info: Option<String>,
}Expand description
Result payload included on a completed TaskStateUpdate.
On success, resource_id points at the created/modified resource.
On failure, error carries a message and the optional additional_info
may carry more context.
Fields§
§resource_id: Option<i32>ID of the primary resource created or modified by the task.
additional_resource_id: Option<i32>ID of an additional resource, if the operation produced one.
resource: Option<HashMap<String, Value>>Free-form resource details. Shape varies by operation type.
error: Option<Value>Error detail, populated only when the task failed.
The Redis Cloud API returns this in two shapes depending on the
failure: sometimes a plain string, and sometimes a structured object
(e.g. {"type": ..., "status": ..., "description": ...}). It is kept
as a Value so both deserialize cleanly; use
ProcessorResponse::error_message to extract a human-readable string.
additional_info: Option<String>Free-form additional context attached by the processor.
Implementations§
Source§impl ProcessorResponse
impl ProcessorResponse
Sourcepub fn error_message(&self) -> Option<String>
pub fn error_message(&self) -> Option<String>
Extract a human-readable error message from Self::error, regardless
of whether the server returned a plain string or a structured object.
For the object shape, prefers the description, then message, then
error keys; falls back to the compact JSON encoding if none are
present. Returns None when no error is set.
Trait Implementations§
Source§impl Clone for ProcessorResponse
impl Clone for ProcessorResponse
Source§fn clone(&self) -> ProcessorResponse
fn clone(&self) -> ProcessorResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more