Skip to main content

ClientConnection

Struct ClientConnection 

Source
pub struct ClientConnection<Transport, State, Cleanliness = ConnectionClean, Evidence = (), Handler = IdentityHandler> { /* private fields */ }
Expand description

Operational client-role connection.

Implementations§

Source§

impl<Transport, State, Cleanliness, Evidence, Handler> ClientConnection<Transport, State, Cleanliness, Evidence, Handler>

Source

pub const fn context(&self) -> &ClientConnectionContext<Evidence>

Returns immutable connection facts.

Source

pub const fn state(&self) -> &State

Returns the caller-owned connection state.

Source

pub async fn receive_wire(&mut self) -> Result<BackendMessage>
where Transport: AsyncRead + Unpin, Handler: ClientMiddleware<State, ClientConnectionContext<Evidence>>,

Receives one backend message at the operational inspection boundary.

§Errors

Returns a transport, decoding, or configured frame-limit error.

Source

pub fn into_parts( self, ) -> (Transport, State, Handler, ClientConnectionContext<Evidence>)

Recovers every owned connection part deliberately.

Source§

impl<Transport, State, Cleanliness, Evidence, Handler> ClientConnection<Transport, State, Cleanliness, Evidence, Handler>
where Transport: AsyncRead + AsyncWrite + Unpin, Handler: ClientMiddleware<State, ClientConnectionContext<Evidence>>,

Source

pub async fn simple_query( self, query: &[u8], ) -> Result<(ClientConnection<Transport, State, ConnectionChanged, Evidence, Handler>, Vec<BackendMessage>), QueryError>

Executes a simple query through typed completion back to operational readiness.

The returned connection is conservatively marked dirty because arbitrary SQL may retain session-local state.

§Errors

Returns an error for invalid query text, I/O or framing failure, an illegal peer transition, COPY entry, or a backend error response.

Auto Trait Implementations§

§

impl<Transport, State, Cleanliness = ConnectionClean, Evidence = (), Handler = IdentityHandler> !Freeze for ClientConnection<Transport, State, Cleanliness, Evidence, Handler>

§

impl<Transport, State, Cleanliness, Evidence, Handler> RefUnwindSafe for ClientConnection<Transport, State, Cleanliness, Evidence, Handler>
where State: RefUnwindSafe, Handler: RefUnwindSafe, Evidence: RefUnwindSafe, Transport: RefUnwindSafe, Cleanliness: RefUnwindSafe,

§

impl<Transport, State, Cleanliness, Evidence, Handler> Send for ClientConnection<Transport, State, Cleanliness, Evidence, Handler>
where State: Send, Handler: Send, Evidence: Send, Transport: Send, Cleanliness: Send,

§

impl<Transport, State, Cleanliness, Evidence, Handler> Sync for ClientConnection<Transport, State, Cleanliness, Evidence, Handler>
where State: Sync, Handler: Sync, Evidence: Sync, Transport: Sync, Cleanliness: Sync,

§

impl<Transport, State, Cleanliness, Evidence, Handler> Unpin for ClientConnection<Transport, State, Cleanliness, Evidence, Handler>
where State: Unpin, Handler: Unpin, Evidence: Unpin, Transport: Unpin, Cleanliness: Unpin,

§

impl<Transport, State, Cleanliness, Evidence, Handler> UnsafeUnpin for ClientConnection<Transport, State, Cleanliness, Evidence, Handler>
where State: UnsafeUnpin, Handler: UnsafeUnpin, Evidence: UnsafeUnpin, Transport: UnsafeUnpin,

§

impl<Transport, State, Cleanliness, Evidence, Handler> UnwindSafe for ClientConnection<Transport, State, Cleanliness, Evidence, Handler>
where State: UnwindSafe, Handler: UnwindSafe, Evidence: UnwindSafe, Transport: UnwindSafe, Cleanliness: UnwindSafe,

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.