pub struct Connection { /* private fields */ }Implementations§
Source§impl Connection
impl Connection
pub async fn connect(cfg: &ConnectConfig) -> Result<Connection, WireError>
Sourcepub async fn connect_with(
cfg: &ConnectConfig,
policy: &AuthPolicy,
) -> Result<Connection, WireError>
pub async fn connect_with( cfg: &ConnectConfig, policy: &AuthPolicy, ) -> Result<Connection, WireError>
Connects and authenticates; only the methods in policy are answered.
Sourcepub async fn connect_with_tls(
cfg: &ConnectConfig,
policy: &AuthPolicy,
tls: Option<Arc<ClientConfig>>,
) -> Result<Connection, WireError>
pub async fn connect_with_tls( cfg: &ConnectConfig, policy: &AuthPolicy, tls: Option<Arc<ClientConfig>>, ) -> Result<Connection, WireError>
Like connect_with, using tls for the handshake when given instead of reading the root file.
Sourcepub fn peak_message_bytes(&self) -> usize
pub fn peak_message_bytes(&self) -> usize
Largest message held whole, or the kept bytes of one streamed DataRow.
pub fn parameter(&self, name: &str) -> Option<&str>
pub fn server_version_num(&self) -> u32
pub fn cancel_handle(&self) -> CancelHandle
pub fn is_poisoned(&self) -> bool
pub async fn simple_query( &mut self, sql: &str, ) -> Result<SimpleResult, WireError>
pub async fn query( &mut self, sql: &str, params: &[Option<&str>], user_sql: bool, limits: &FetchLimits, ) -> Result<QueryResult, WireError>
Sourcepub async fn explain_unbound(
&mut self,
sql: &str,
max_bytes: usize,
) -> Result<QueryResult, WireError>
pub async fn explain_unbound( &mut self, sql: &str, max_bytes: usize, ) -> Result<QueryResult, WireError>
Runs one EXPLAIN text through the simple protocol. The server must parse it as one statement first,
and no Query is sent unless it does. The plan’s bytes are capped at max_bytes while they are read.
Auto Trait Implementations§
impl !RefUnwindSafe for Connection
impl !Sync for Connection
impl !UnwindSafe for Connection
impl Forget for Connection
impl Freeze for Connection
impl Move for Connection
impl Send for Connection
impl Unpin for Connection
impl UnsafeUnpin for Connection
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more