Skip to main content

ClientExt

Trait ClientExt 

Source
pub trait ClientExt: Sized {
    // Required methods
    fn ping(&self) -> impl Future<Output = Result<()>> + Send;
    fn kill_query(
        &self,
        query_id: &str,
    ) -> impl Future<Output = Result<()>> + Send;
    fn with_query_id(self, query_id: impl Into<String>) -> Self;
    fn with_session_id(self, session_id: impl Into<String>) -> Self;
    fn with_role(self, role: impl Into<String>) -> Self;
}
Available on crate feature ext only.
Expand description

Statement-level controls upstream’s Client carries only as raw settings. Sized because the with_* methods consume and return the client.

Required Methods§

Source

fn ping(&self) -> impl Future<Output = Result<()>> + Send

SELECT 1; errors on a transport failure or a bad credential.

Source

fn kill_query(&self, query_id: &str) -> impl Future<Output = Result<()>> + Send

Stop query_id and wait; matching nothing is not an error.

Source

fn with_query_id(self, query_id: impl Into<String>) -> Self

What system.query_log records and Self::kill_query matches on.

Source

fn with_session_id(self, session_id: impl Into<String>) -> Self

Bind statements to a session, so SET and temp tables survive between.

Source

fn with_role(self, role: impl Into<String>) -> Self

Run statements under role. Client::with_default_roles clears it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ClientExt for Client

Source§

async fn ping(&self) -> Result<()>

Source§

async fn kill_query(&self, query_id: &str) -> Result<()>

Source§

fn with_query_id(self, query_id: impl Into<String>) -> Self

Source§

fn with_session_id(self, session_id: impl Into<String>) -> Self

Source§

fn with_role(self, role: impl Into<String>) -> Self

Implementors§