pub struct SqlServerProtocol {}Expand description
SQL Server protocol adapter implementation
Implementations§
Source§impl SqlServerProtocol
impl SqlServerProtocol
Sourcepub fn parse_login_packet(
&self,
data: &[u8],
) -> NirvResult<HashMap<String, String>>
pub fn parse_login_packet( &self, data: &[u8], ) -> NirvResult<HashMap<String, String>>
Parse a TDS login packet
Sourcepub fn parse_sql_batch(&self, data: &[u8]) -> NirvResult<String>
pub fn parse_sql_batch(&self, data: &[u8]) -> NirvResult<String>
Parse a SQL batch packet
Sourcepub fn create_colmetadata(&self, columns: &[ColumnMetadata]) -> Vec<u8> ⓘ
pub fn create_colmetadata(&self, columns: &[ColumnMetadata]) -> Vec<u8> ⓘ
Create column metadata token
Sourcepub fn create_row(&self, row: &Row, columns: &[ColumnMetadata]) -> Vec<u8> ⓘ
pub fn create_row(&self, row: &Row, columns: &[ColumnMetadata]) -> Vec<u8> ⓘ
Create a data row token
Sourcepub fn create_done(&self, status: u16, cur_cmd: u16, row_count: u64) -> Vec<u8> ⓘ
pub fn create_done(&self, status: u16, cur_cmd: u16, row_count: u64) -> Vec<u8> ⓘ
Create a DONE token
Sourcepub fn create_error_response(
&self,
error_number: u32,
message: &str,
severity: u8,
) -> Vec<u8> ⓘ
pub fn create_error_response( &self, error_number: u32, message: &str, severity: u8, ) -> Vec<u8> ⓘ
Create an error response
Sourcepub fn value_to_tds_type(&self, value: &Value) -> u8
pub fn value_to_tds_type(&self, value: &Value) -> u8
Convert Value to TDS type code
Trait Implementations§
Source§impl Debug for SqlServerProtocol
impl Debug for SqlServerProtocol
Source§impl Default for SqlServerProtocol
impl Default for SqlServerProtocol
Source§impl ProtocolAdapter for SqlServerProtocol
impl ProtocolAdapter for SqlServerProtocol
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 SqlServerProtocol
impl RefUnwindSafe for SqlServerProtocol
impl Send for SqlServerProtocol
impl Sync for SqlServerProtocol
impl Unpin for SqlServerProtocol
impl UnwindSafe for SqlServerProtocol
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