#[non_exhaustive]pub struct Operation {
pub name: String,
pub metadata: Option<Any>,
pub done: bool,
pub result: Option<Result>,
}Expand description
This resource represents a long-running operation that is the result of a network API call.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe server-assigned name, which is only unique within the same service that
originally returns it. If you use the default HTTP mapping, the
name should be a resource name ending with operations/{unique_id}.
metadata: Option<Any>Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
done: boolIf the value is false, it means the operation is still in progress.
If true, the operation is completed, and either error or response is
available.
result: Option<Result>The operation result, which can be either an error or a valid response.
If done == false, neither error nor response is set.
If done == true, exactly one of error or response can be set.
Some services might not provide the result.
Implementations§
Source§impl Operation
impl Operation
Sourcepub fn set_result<T: Into<Option<Result>>>(self, v: T) -> Self
pub fn set_result<T: Into<Option<Result>>>(self, v: T) -> Self
Sets the value of result.
Sourcepub fn get_error(&self) -> Option<&Box<Status>>
pub fn get_error(&self) -> Option<&Box<Status>>
The value of result
if it holds a Error, None if the field is not set or
holds a different branch.
Sourcepub fn get_response(&self) -> Option<&Box<Any>>
pub fn get_response(&self) -> Option<&Box<Any>>
The value of result
if it holds a Response, None if the field is not set or
holds a different branch.