pub struct CancelToken { /* private fields */ }Expand description
Asks the server to cancel what a connection is running.
It can be sent to another thread. The request goes over a new connection,
as the protocol requires; the statement being cancelled fails with SQLSTATE
57014. With several tasks sharing the connection, the statement running
when the request arrives is the one cancelled.
Implementations§
Source§impl CancelToken
impl CancelToken
Sourcepub async fn cancel(&self) -> Result<(), Error>
pub async fn cancel(&self) -> Result<(), Error>
Sends the cancel request. Success means the server received it, not that something was cancelled: the statement may have finished first.
Fails with ErrorKind::Closed, sending nothing, when the token was
taken from a PooledClient that has gone back
to its pool since.
Trait Implementations§
Source§impl Clone for CancelToken
impl Clone for CancelToken
Auto Trait Implementations§
impl !RefUnwindSafe for CancelToken
impl !UnwindSafe for CancelToken
impl Forget for CancelToken
impl Freeze for CancelToken
impl Move for CancelToken
impl Send for CancelToken
impl Sync for CancelToken
impl Unpin for CancelToken
impl UnsafeUnpin for CancelToken
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
Mutably borrows from an owned value. Read more