libpq 3.0.0

Safe binding for libpq
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * [Canceling Queries in Progress](https://www.postgresql.org/docs/current/libpq-cancel.html)
 */
impl Connection {
    /**
     * Creates a data structure containing the information needed to cancel a command issued
     * through a particular database connection.
     *
     * See
     * [PQgetCancel](https://www.postgresql.org/docs/current/libpq-cancel.html#LIBPQ-PQGETCANCEL).
     */
    pub fn cancel(&self) -> crate::connection::Cancel {
        unsafe { pq_sys::PQgetCancel(self.into()) }.into()
    }
}