Struct mysql::conn::Conn [] [src]

pub struct Conn {
    // some fields omitted
}

Mysql connection.

Methods

impl Conn

fn new<T: Into<Opts>>(opts: T) -> MyResult<Conn>

Creates new Conn.

fn reset(&mut self) -> MyResult<()>

Resets MyConn (drops state then reconnects).

fn ping(&mut self) -> bool

Executes COM_PING on Conn. Return true on success or false on error.

fn start_transaction<'a>(&'a mut self, consistent_snapshot: bool, isolation_level: Option<IsolationLevel>, readonly: Option<bool>) -> MyResult<Transaction<'a>>

Starts new transaction with provided options. readonly is only available since MySQL 5.6.5.

fn query<'a, T: AsRef<str> + 'a>(&'a mut self, query: T) -> MyResult<QueryResult<'a>>

Implements text protocol of mysql server.

Executes mysql query on Conn. QueryResult will borrow Conn until the end of its scope.

fn prepare<'a, T: AsRef<str> + 'a>(&'a mut self, query: T) -> MyResult<Stmt<'a>>

Implements binary protocol of mysql server.

Prepares mysql statement on Conn. Stmt will borrow Conn until the end of its scope.

This call will take statement from cache if has been prepared on this connection.

fn prep_exec<'a, A, T>(&'a mut self, query: A, params: T) -> MyResult<QueryResult<'a>> where A: AsRef<str> + 'a, T: Into<Params>

Prepares and executes statement in one call.

This call will take statement from cache if has been prepared on this connection.

Trait Implementations

impl Drop for Conn

fn drop(&mut self)

Derived Implementations

impl Debug for Conn

fn fmt(&self, __arg_0: &mut Formatter) -> Result