pub struct CancelHandle<T>where
T: AsyncRead + AsyncWrite,{ /* private fields */ }Expand description
Handle for cancelling queries on a connection.
This can be cloned and sent to other tasks to enable cancellation from a different async context.
Implementations§
Source§impl<T> CancelHandle<T>
impl<T> CancelHandle<T>
Sourcepub async fn cancel(&self) -> Result<(), CodecError>
pub async fn cancel(&self) -> Result<(), CodecError>
Send an Attention packet to cancel the current query.
This can be called from a different task while the main task is blocked reading results.
Sourcepub async fn wait_cancelled(&self)
pub async fn wait_cancelled(&self)
Wait for the cancellation to complete.
This waits until the server acknowledges the cancellation with a DONE token containing the ATTENTION flag.
Sourcepub fn is_cancelling(&self) -> bool
pub fn is_cancelling(&self) -> bool
Check if a cancellation is currently in progress.
Trait Implementations§
Source§impl<T> Clone for CancelHandle<T>where
T: AsyncRead + AsyncWrite,
impl<T> Clone for CancelHandle<T>where
T: AsyncRead + AsyncWrite,
Auto Trait Implementations§
impl<T> Freeze for CancelHandle<T>
impl<T> !RefUnwindSafe for CancelHandle<T>
impl<T> Send for CancelHandle<T>where
T: Send,
impl<T> Sync for CancelHandle<T>where
T: Send,
impl<T> Unpin for CancelHandle<T>
impl<T> !UnwindSafe for CancelHandle<T>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)