Struct google_cloud_longrunning::longrunning::Operation
source · pub struct Operation<T: Message + Default> { /* private fields */ }
Implementations§
source§impl<T: Message + Default> Operation<T>
impl<T: Message + Default> Operation<T>
pub fn new(client: OperationsClient, inner: InternalOperation) -> Self
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
sourcepub async fn poll(&mut self) -> Result<Option<T>, Status>
pub async fn poll(&mut self) -> Result<Option<T>, Status>
Poll fetches the latest state of a long-running operation.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true; if resp != nil, the response of the operation is stored in resp.
sourcepub async fn wait(
&mut self,
option: Option<RetrySetting>,
) -> Result<Option<T>, Status>
pub async fn wait( &mut self, option: Option<RetrySetting>, ) -> Result<Option<T>, Status>
wait implements Wait, taking exponentialBackoff and sleeper arguments for testing.
sourcepub async fn cancel(&mut self) -> Result<(), Status>
pub async fn cancel(&mut self) -> Result<(), Status>
Cancel 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 status.Code(err) == codes.Unimplemented. Clients can use Poll 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, op.Poll returns an error with code Canceled.
sourcepub async fn delete(&mut self) -> Result<(), Status>
pub async fn delete(&mut self) -> Result<(), Status>
Delete 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, status.Code(err) == codes.Unimplemented.
Auto Trait Implementations§
impl<T> !Freeze for Operation<T>
impl<T> !RefUnwindSafe for Operation<T>
impl<T> Send for Operation<T>
impl<T> Sync for Operation<T>
impl<T> Unpin for Operation<T>where
T: Unpin,
impl<T> !UnwindSafe for Operation<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request