pub struct Operations { /* private fields */ }Expand description
Implements a client for the Long Running Operations API.
§Service Description
Manages long-running operations with an API service.
When an API method normally takes long time to complete, it can be designed
to return Operation to the client, and the
client can use this interface to receive the real response asynchronously by
polling the operation resource, or pass the operation resource to another API
(such as Pub/Sub API) to receive the response. Any API service that returns
long-running operations should implement the Operations interface so
developers can have a consistent client experience.
§Configuration
Operations has various configuration parameters, the defaults should
work with most applications.
§Pooling and Cloning
Operations holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap Operations in
an Rc or Arc to reuse it, because it already uses an Arc
internally.
Implementations§
Source§impl Operations
impl Operations
Sourcepub async fn new_with_config(conf: ClientConfig) -> Result<Self>
pub async fn new_with_config(conf: ClientConfig) -> Result<Self>
Creates a new client with the specified configuration.
Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: Operations + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: Operations + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is when mocking the client.
Sourcepub fn list_operations(&self, name: impl Into<String>) -> ListOperations
pub fn list_operations(&self, name: impl Into<String>) -> ListOperations
Lists operations that match the specified filter in the request. If the
server doesn’t support this method, it returns UNIMPLEMENTED.
Sourcepub fn get_operation(&self, name: impl Into<String>) -> GetOperation
pub fn get_operation(&self, name: impl Into<String>) -> GetOperation
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
Sourcepub fn delete_operation(&self, name: impl Into<String>) -> DeleteOperation
pub fn delete_operation(&self, name: impl Into<String>) -> DeleteOperation
Deletes a long-running operation. This method indicates that the client is
no longer interested in the operation result. It does not cancel the
operation. If the server doesn’t support this method, it returns
google.rpc.Code.UNIMPLEMENTED.
Sourcepub fn cancel_operation(&self, name: impl Into<String>) -> CancelOperation
pub fn cancel_operation(&self, name: impl Into<String>) -> CancelOperation
Starts asynchronous cancellation on a long-running operation. The server
makes a best effort to cancel the operation, but success is not
guaranteed. If the server doesn’t support this method, it returns
google.rpc.Code.UNIMPLEMENTED. Clients can use
Operations.GetOperation or
other methods to check whether the cancellation succeeded or whether the
operation completed despite cancellation. On successful cancellation,
the operation is not deleted; instead, it becomes an operation with
an Operation.error value with a
google.rpc.Status.code of 1, corresponding to
Code.CANCELLED.
Trait Implementations§
Source§impl Clone for Operations
impl Clone for Operations
Source§fn clone(&self) -> Operations
fn clone(&self) -> Operations
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more