Struct tokio_postgres::CancelToken[][src]

pub struct CancelToken { /* fields omitted */ }

The capability to request cancellation of in-progress queries on a connection.

Implementations

impl CancelToken[src]

pub async fn cancel_query<T>(&self, tls: T) -> Result<(), Error> where
    T: MakeTlsConnect<Socket>, 
[src]

Attempts to cancel the in-progress query on the connection associated with this CancelToken.

The server provides no information about whether a cancellation attempt was successful or not. An error will only be returned if the client was unable to connect to the database.

Cancellation is inherently racy. There is no guarantee that the cancellation request will reach the server before the query terminates normally, or that the connection associated with this token is still active.

Requires the runtime Cargo feature (enabled by default).

pub async fn cancel_query_raw<S, T>(
    &self,
    stream: S,
    tls: T
) -> Result<(), Error> where
    S: AsyncRead + AsyncWrite + Unpin,
    T: TlsConnect<S>, 
[src]

Like cancel_query, but uses a stream which is already connected to the server rather than opening a new connection itself.

Trait Implementations

impl Clone for CancelToken[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,