pub struct SQLiteProtocolAdapter { /* private fields */ }Expand description
SQLite protocol adapter implementation
Note: SQLite doesn’t have a traditional network protocol like PostgreSQL or MySQL. This implementation provides a simplified protocol interface that can work with SQLite clients through file-based connections and basic query execution.
Implementations§
Source§impl SQLiteProtocolAdapter
impl SQLiteProtocolAdapter
Sourcepub fn with_database_path(database_path: String) -> Self
pub fn with_database_path(database_path: String) -> Self
Create SQLite protocol adapter with specific database path
Trait Implementations§
Source§impl Debug for SQLiteProtocolAdapter
impl Debug for SQLiteProtocolAdapter
Source§impl Default for SQLiteProtocolAdapter
impl Default for SQLiteProtocolAdapter
Source§impl ProtocolAdapter for SQLiteProtocolAdapter
impl ProtocolAdapter for SQLiteProtocolAdapter
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 SQLiteProtocolAdapter
impl RefUnwindSafe for SQLiteProtocolAdapter
impl Send for SQLiteProtocolAdapter
impl Sync for SQLiteProtocolAdapter
impl Unpin for SQLiteProtocolAdapter
impl UnwindSafe for SQLiteProtocolAdapter
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