Skip to main content

PoolableClient

Struct PoolableClient 

Source
pub struct PoolableClient<F: ConnectionFactory> { /* private fields */ }

Implementations§

Source§

impl<F: ConnectionFactory> PoolableClient<F>

Source

pub async fn close(self) -> Result<(), ElefantClientError>

Gracefully close this connection by sending Terminate to the backend. The connection is not returned to the pool. Consumes the client.

Methods from Deref<Target = PostgresClient<F>>§

Source

pub async fn copy_out( &mut self, query: &(impl Statement + ?Sized), parameters: &[&dyn ToSql], ) -> Result<CopyReader<'_, F>, ElefantClientError>

Source

pub async fn copy_in( &mut self, query: &(impl Statement + ?Sized), parameters: &[&dyn ToSql], ) -> Result<CopyWriter<'_, F>, ElefantClientError>

Source

pub async fn execute_non_query<S>( &mut self, query: &S, parameters: &[&dyn ToSql], ) -> Result<(), ElefantClientError>
where S: Statement + ?Sized,

Execute a non-query statement using binary mode (with prepared statements)

Source

pub async fn execute_non_query_simple( &mut self, query: &str, ) -> Result<(), ElefantClientError>

Execute a non-query statement using simple query mode (text format, no parameters)

Source

pub async fn query( &mut self, query: &(impl Statement + ?Sized), parameters: &[&dyn ToSql], ) -> Result<QueryResult<'_, F>, ElefantClientError>

Execute a query in binary mode - always uses prepared statements

Source

pub async fn query_simple( &mut self, query: &str, ) -> Result<SimpleQueryResult<'_, F>, ElefantClientError>

Execute a simple query in text mode - only accepts &str, no parameters

Source

pub async fn prepare_query( &mut self, query: &str, ) -> Result<PreparedQuery, ElefantClientError>

Source

pub async fn create_replication_slot( &mut self, slot_name: &str, output_plugin: &str, ) -> Result<(String, Lsn), ElefantClientError>

Source

pub async fn drop_replication_slot( &mut self, slot_name: &str, ) -> Result<(), ElefantClientError>

Source

pub async fn start_replication( &mut self, slot_name: &str, lsn: Lsn, options: &str, ) -> Result<ReplicationStream<'_, F>, ElefantClientError>

Source

pub async fn reset(&mut self) -> Result<(), ElefantClientError>

Source

pub fn get_parameter(&self, name: &str) -> Option<&str>

Get a server parameter received via ParameterStatus messages.

PostgreSQL sends these during connection startup and whenever a session parameter changes. Common parameters include server_version, server_encoding, TimeZone, etc.

Trait Implementations§

Source§

impl<F: ConnectionFactory> Deref for PoolableClient<F>

Source§

type Target = PostgresClient<F>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<F: ConnectionFactory> DerefMut for PoolableClient<F>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<F: ConnectionFactory> Drop for PoolableClient<F>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more