pub struct PostgresProtocol {}Expand description
PostgreSQL protocol adapter implementation
Implementations§
Trait Implementations§
Source§impl Debug for PostgresProtocol
impl Debug for PostgresProtocol
Source§impl Default for PostgresProtocol
impl Default for PostgresProtocol
Source§impl ProtocolAdapter for PostgresProtocol
impl ProtocolAdapter for PostgresProtocol
Source§fn accept_connection<'life0, 'async_trait>(
&'life0 self,
stream: TcpStream,
) -> Pin<Box<dyn Future<Output = NirvResult<Connection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn accept_connection<'life0, 'async_trait>(
&'life0 self,
stream: TcpStream,
) -> Pin<Box<dyn Future<Output = NirvResult<Connection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Accept a new connection and perform initial handshake
Source§fn authenticate<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Connection,
credentials: Credentials,
) -> Pin<Box<dyn Future<Output = NirvResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn authenticate<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Connection,
credentials: Credentials,
) -> Pin<Box<dyn Future<Output = NirvResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Authenticate a connection with provided credentials
Source§fn handle_query<'life0, 'life1, 'async_trait>(
&'life0 self,
_conn: &'life1 Connection,
_query: ProtocolQuery,
) -> Pin<Box<dyn Future<Output = NirvResult<ProtocolResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_query<'life0, 'life1, 'async_trait>(
&'life0 self,
_conn: &'life1 Connection,
_query: ProtocolQuery,
) -> Pin<Box<dyn Future<Output = NirvResult<ProtocolResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle a query from the client and return a response
Source§fn get_protocol_type(&self) -> ProtocolType
fn get_protocol_type(&self) -> ProtocolType
Get the protocol type this adapter handles
Source§fn parse_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_conn: &'life1 Connection,
data: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = NirvResult<ProtocolQuery>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn parse_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_conn: &'life1 Connection,
data: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = NirvResult<ProtocolQuery>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Parse protocol-specific message into internal representation
Source§fn format_response<'life0, 'life1, 'async_trait>(
&'life0 self,
_conn: &'life1 Connection,
result: QueryResult,
) -> Pin<Box<dyn Future<Output = NirvResult<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn format_response<'life0, 'life1, 'async_trait>(
&'life0 self,
_conn: &'life1 Connection,
result: QueryResult,
) -> Pin<Box<dyn Future<Output = NirvResult<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Format internal query result into protocol-specific response
Source§fn terminate_connection<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Connection,
) -> Pin<Box<dyn Future<Output = NirvResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn terminate_connection<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Connection,
) -> Pin<Box<dyn Future<Output = NirvResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle connection termination
Auto Trait Implementations§
impl Freeze for PostgresProtocol
impl RefUnwindSafe for PostgresProtocol
impl Send for PostgresProtocol
impl Sync for PostgresProtocol
impl Unpin for PostgresProtocol
impl UnwindSafe for PostgresProtocol
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