#[non_exhaustive]pub struct Operation {
pub name: String,
pub metadata: Option<Any>,
pub done: bool,
pub result: Option<Result>,
/* private fields */
}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
pub fn new() -> Self
Sourcepub fn set_metadata<T>(self, v: T) -> Self
pub fn set_metadata<T>(self, v: T) -> Self
Sets the value of metadata.
Sourcepub fn set_or_clear_metadata<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_metadata<T>(self, v: Option<T>) -> Self
Sets or clears the value of metadata.
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.
Note that all the setters affecting result are mutually
exclusive.
Sourcepub fn error(&self) -> Option<&Box<Status>>
pub fn 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 set_error<T: Into<Box<Status>>>(self, v: T) -> Self
pub fn set_error<T: Into<Box<Status>>>(self, v: T) -> Self
Sets the value of result
to hold a Error.
Note that all the setters affecting result are
mutually exclusive.