[−][src]Struct mysql::Conn
Mysql connection.
Implementations
impl Conn
[src]
pub fn connection_id(&self) -> u32
[src]
Returns connection identifier.
pub fn affected_rows(&self) -> u64
[src]
Returns number of rows affected by the last query.
pub fn last_insert_id(&self) -> u64
[src]
Returns last insert id of the last query.
Returns zero if there was no last insert id.
pub fn warnings(&self) -> u16
[src]
Returns number of warnings, reported by the server.
pub fn info_ref(&self) -> &[u8]
[src]
Info, reported by the server.
Will be empty if not defined.
pub fn info_str(&self) -> Cow<'_, str>
[src]
Info, reported by the server.
Will be empty if not defined.
pub fn new<T: Into<Opts>>(opts: T) -> Result<Conn>
[src]
Creates new Conn
.
pub fn reset(&mut self) -> Result<()>
[src]
Resets MyConn
(drops state then reconnects).
pub fn ping(&mut self) -> bool
[src]
Executes COM_PING
on Conn
. Return true
on success or false
on error.
pub fn select_db(&mut self, schema: &str) -> bool
[src]
Executes COM_INIT_DB
on Conn
.
pub fn start_transaction(&mut self, tx_opts: TxOpts) -> Result<Transaction<'_>>
[src]
Starts new transaction with provided options.
readonly
is only available since MySQL 5.6.5.
pub fn set_local_infile_handler(&mut self, handler: Option<LocalInfileHandler>)
[src]
Sets a callback to handle requests for local files. These are
caused by using LOAD DATA LOCAL INFILE
queries. The
callback is passed the filename, and a Write
able object
to receive the contents of that file.
Specifying None
will reset the handler to the one specified
in the Opts
for this connection.
pub fn no_backslash_escape(&self) -> bool
[src]
Trait Implementations
impl Debug for Conn
[src]
impl Drop for Conn
[src]
impl Queryable for Conn
[src]
fn query_iter<T: AsRef<str>>(
&mut self,
query: T
) -> Result<QueryResult<'_, '_, '_, Text>>
[src]
&mut self,
query: T
) -> Result<QueryResult<'_, '_, '_, Text>>
fn prep<T: AsRef<str>>(&mut self, query: T) -> Result<Statement>
[src]
fn close(&mut self, stmt: Statement) -> Result<()>
[src]
fn exec_iter<S, P>(
&mut self,
stmt: S,
params: P
) -> Result<QueryResult<'_, '_, '_, Binary>> where
S: AsStatement,
P: Into<Params>,
[src]
&mut self,
stmt: S,
params: P
) -> Result<QueryResult<'_, '_, '_, Binary>> where
S: AsStatement,
P: Into<Params>,
fn query<T, Q>(&mut self, query: Q) -> Result<Vec<T>> where
Q: AsRef<str>,
T: FromRow,
[src]
Q: AsRef<str>,
T: FromRow,
fn query_opt<T, Q>(
&mut self,
query: Q
) -> Result<Vec<StdResult<T, FromRowError>>> where
Q: AsRef<str>,
T: FromRow,
[src]
&mut self,
query: Q
) -> Result<Vec<StdResult<T, FromRowError>>> where
Q: AsRef<str>,
T: FromRow,
fn query_first<T, Q>(&mut self, query: Q) -> Result<Option<T>> where
Q: AsRef<str>,
T: FromRow,
[src]
Q: AsRef<str>,
T: FromRow,
fn query_first_opt<T, Q>(
&mut self,
query: Q
) -> Result<Option<StdResult<T, FromRowError>>> where
Q: AsRef<str>,
T: FromRow,
[src]
&mut self,
query: Q
) -> Result<Option<StdResult<T, FromRowError>>> where
Q: AsRef<str>,
T: FromRow,
fn query_map<T, F, Q, U>(&mut self, query: Q, f: F) -> Result<Vec<U>> where
Q: AsRef<str>,
T: FromRow,
F: FnMut(T) -> U,
[src]
Q: AsRef<str>,
T: FromRow,
F: FnMut(T) -> U,
fn query_map_opt<T, F, Q, U>(&mut self, query: Q, f: F) -> Result<Vec<U>> where
Q: AsRef<str>,
T: FromRow,
F: FnMut(StdResult<T, FromRowError>) -> U,
[src]
Q: AsRef<str>,
T: FromRow,
F: FnMut(StdResult<T, FromRowError>) -> U,
fn query_fold<T, F, Q, U>(&mut self, query: Q, init: U, f: F) -> Result<U> where
Q: AsRef<str>,
T: FromRow,
F: FnMut(U, T) -> U,
[src]
Q: AsRef<str>,
T: FromRow,
F: FnMut(U, T) -> U,
fn query_fold_opt<T, F, Q, U>(&mut self, query: Q, init: U, f: F) -> Result<U> where
Q: AsRef<str>,
T: FromRow,
F: FnMut(U, StdResult<T, FromRowError>) -> U,
[src]
Q: AsRef<str>,
T: FromRow,
F: FnMut(U, StdResult<T, FromRowError>) -> U,
fn query_drop<Q>(&mut self, query: Q) -> Result<()> where
Q: AsRef<str>,
[src]
Q: AsRef<str>,
fn exec_batch<S, P, I>(&mut self, stmt: S, params: I) -> Result<()> where
Self: Sized,
S: AsStatement,
P: Into<Params>,
I: IntoIterator<Item = P>,
[src]
Self: Sized,
S: AsStatement,
P: Into<Params>,
I: IntoIterator<Item = P>,
fn exec<T, S, P>(&mut self, stmt: S, params: P) -> Result<Vec<T>> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
[src]
S: AsStatement,
P: Into<Params>,
T: FromRow,
fn exec_opt<T, S, P>(
&mut self,
stmt: S,
params: P
) -> Result<Vec<StdResult<T, FromRowError>>> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
[src]
&mut self,
stmt: S,
params: P
) -> Result<Vec<StdResult<T, FromRowError>>> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
fn exec_first<T, S, P>(&mut self, stmt: S, params: P) -> Result<Option<T>> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
[src]
S: AsStatement,
P: Into<Params>,
T: FromRow,
fn exec_first_opt<T, S, P>(
&mut self,
stmt: S,
params: P
) -> Result<Option<StdResult<T, FromRowError>>> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
[src]
&mut self,
stmt: S,
params: P
) -> Result<Option<StdResult<T, FromRowError>>> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
fn exec_map<T, S, P, F, U>(
&mut self,
stmt: S,
params: P,
f: F
) -> Result<Vec<U>> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
F: FnMut(T) -> U,
[src]
&mut self,
stmt: S,
params: P,
f: F
) -> Result<Vec<U>> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
F: FnMut(T) -> U,
fn exec_map_opt<T, S, P, F, U>(
&mut self,
stmt: S,
params: P,
f: F
) -> Result<Vec<U>> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
F: FnMut(StdResult<T, FromRowError>) -> U,
[src]
&mut self,
stmt: S,
params: P,
f: F
) -> Result<Vec<U>> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
F: FnMut(StdResult<T, FromRowError>) -> U,
fn exec_fold<T, S, P, U, F>(
&mut self,
stmt: S,
params: P,
init: U,
f: F
) -> Result<U> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
F: FnMut(U, T) -> U,
[src]
&mut self,
stmt: S,
params: P,
init: U,
f: F
) -> Result<U> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
F: FnMut(U, T) -> U,
fn exec_fold_opt<T, S, P, U, F>(
&mut self,
stmt: S,
params: P,
init: U,
f: F
) -> Result<U> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
F: FnMut(U, StdResult<T, FromRowError>) -> U,
[src]
&mut self,
stmt: S,
params: P,
init: U,
f: F
) -> Result<U> where
S: AsStatement,
P: Into<Params>,
T: FromRow,
F: FnMut(U, StdResult<T, FromRowError>) -> U,
fn exec_drop<S, P>(&mut self, stmt: S, params: P) -> Result<()> where
S: AsStatement,
P: Into<Params>,
[src]
S: AsStatement,
P: Into<Params>,
Auto Trait Implementations
impl RefUnwindSafe for Conn
impl Send for Conn
impl Sync for Conn
impl Unpin for Conn
impl UnwindSafe for Conn
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,