Struct convergence::connection::Connection
source · pub struct Connection<E: Engine> { /* private fields */ }
Expand description
Describes a connection using a specific engine. Contains connection state including prepared statements and portals.
Implementations§
source§impl<E: Engine> Connection<E>
impl<E: Engine> Connection<E>
sourcepub async fn run(
&mut self,
stream: impl AsyncRead + AsyncWrite + Unpin
) -> Result<(), ConnectionError>
pub async fn run( &mut self, stream: impl AsyncRead + AsyncWrite + Unpin ) -> Result<(), ConnectionError>
Given a stream (typically TCP), extract Postgres protocol messages and respond accordingly. This function only returns when the connection is closed (either gracefully or due to an error).