pub struct Connection { /* private fields */ }Implementations§
Source§impl Connection
impl Connection
pub fn new(config: Config) -> Result<Self>
pub fn output(&self) -> &[u8] ⓘ
Sourcepub fn consume_output(&mut self, n: usize) -> Result<bool>
pub fn consume_output(&mut self, n: usize) -> Result<bool>
Acknowledge n written bytes of output().
Returns true when an event is now deliverable without further input,
in which case the host must call next_event() right away. This matters
for COM_STMT_CLOSE and COM_QUIT: the server never answers them, so their
Completed / Closed is produced by this acknowledgement itself and no
read completion or timer would otherwise wake a completion-driven host.
pub fn receive(&mut self, b: &[u8]) -> Result<()>
pub fn tls_established(&mut self) -> Result<()>
Sourcepub fn rsa_seed(&mut self, seed: [u8; 20]) -> Result<()>
pub fn rsa_seed(&mut self, seed: [u8; 20]) -> Result<()>
RSA OAEP SHA1 consumes this one-use, host-generated cryptographic seed.
Sourcepub fn can_accept(&self) -> bool
pub fn can_accept(&self) -> bool
Whether a command submitted now would be admitted. This is the exact rule
every command method applies: the session is authenticated and idle, the
previous command’s Completed has been delivered and all output has been
acknowledged. A host queue can gate submission on it instead of copying
the preconditions. Unlike is_ready, it also requires flushed output.
pub fn query( &mut self, token: Token, sql: &str, deadline: Option<Instant>, ) -> Result<()>
pub fn prepare( &mut self, token: Token, sql: &str, deadline: Option<Instant>, ) -> Result<()>
pub fn execute( &mut self, token: Token, id: u32, params: &[Value], deadline: Option<Instant>, ) -> Result<()>
pub fn ping(&mut self, token: Token) -> Result<()>
pub fn reset_connection(&mut self, token: Token) -> Result<()>
pub fn reset_statement(&mut self, token: Token, id: u32) -> Result<()>
pub fn close_statement(&mut self, token: Token, id: u32) -> Result<()>
Sourcepub fn statements(&self) -> &[Statement]
pub fn statements(&self) -> &[Statement]
Prepared statements the server still holds for this session. A statement being closed stays listed until its COM_STMT_CLOSE bytes are acknowledged.