pub struct QueryCanceller { /* private fields */ }Expand description
A cloneable controller that cancels the query of the QueryHandle it was obtained from.
It remains usable from any task, even after the handle has been consumed by execution or the execution future has been dropped.
Implementations§
Source§impl QueryCanceller
impl QueryCanceller
Sourcepub fn request_id(&self) -> &str
pub fn request_id(&self) -> &str
Returns the client-generated query request ID targeted by this canceller.
Sourcepub async fn cancel(&self) -> Result<QueryCancelStatus>
pub async fn cancel(&self) -> Result<QueryCancelStatus>
Requests remote cancellation and waits for the abort response.
On success, reports what the cancellation achieved as a QueryCancelStatus.
This method never returns an ErrorKind::Cancelled error; that error is what
QueryHandle::execute returns once the cancellation takes effect.
§Errors
Returns ErrorKind::Network, ErrorKind::Timeout,
ErrorKind::Server,
ErrorKind::SessionExpired, or
ErrorKind::Protocol. Transient transport failures are retried within the
configured cancellation deadline, and a failed call never caches a successful status, so a later call can
retry the cancellation.
Trait Implementations§
Source§impl Clone for QueryCanceller
impl Clone for QueryCanceller
Source§fn clone(&self) -> QueryCanceller
fn clone(&self) -> QueryCanceller
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more