pub struct ConnectionBox {
    pub conn: Option<Box<dyn Connection>>,
    pub manager_proxy: ConnManager,
    pub auto_close: bool,
}

Fields§

§conn: Option<Box<dyn Connection>>§manager_proxy: ConnManager§auto_close: bool

Trait Implementations§

source§

impl Connection for ConnectionBox

source§

fn get_rows( &mut self, sql: &str, params: Vec<Value> ) -> BoxFuture<'_, Result<Vec<Box<dyn Row>>, Error>>

Execute a query that is expected to return a result set, such as a SELECT statement
source§

fn exec( &mut self, sql: &str, params: Vec<Value> ) -> BoxFuture<'_, Result<ExecResult, Error>>

Execute a query that is expected to update some rows.
source§

fn close(&mut self) -> BoxFuture<'_, Result<(), Error>>

close connection Normally conn is dropped when the link is dropped, but it is recommended to actively close this function so that the database does not report errors. If &mut self is not satisfied close, when you need mut self, It is recommended to use Option and then call take to take ownership and then if let Some(v) = self.inner.take() {v.lose ().await; }
source§

fn ping(&mut self) -> BoxFuture<'_, Result<(), Error>>

ping
source§

fn begin(&mut self) -> BoxFuture<'_, Result<(), Error>>

an translation impl begin
source§

fn commit(&mut self) -> BoxFuture<'_, Result<(), Error>>

an translation impl commit
source§

fn rollback(&mut self) -> BoxFuture<'_, Result<(), Error>>

an translation impl rollback
source§

fn get_values( &mut self, sql: &str, params: Vec<Value> ) -> BoxFuture<'_, Result<Vec<Value>, Error>>

Execute a query that is expected to return a result set, such as a SELECT statement
source§

impl Debug for ConnectionBox

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for ConnectionBox

§

type Target = Box<dyn Connection>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for ConnectionBox

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Drop for ConnectionBox

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Sync for ConnectionBox

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.