[][src]Struct rsfbclient::Connection

pub struct Connection<C> where
    C: FirebirdClient
{ /* fields omitted */ }

A connection to a firebird database

Implementations

impl<C> Connection<C> where
    C: FirebirdClient
[src]

pub fn drop_database(self) -> Result<(), FbError>[src]

Drop the current database

pub fn with_transaction<T>(
    &self,
    closure: impl FnOnce(&mut Transaction<'_, C>) -> Result<T, FbError>
) -> Result<T, FbError>
[src]

Run a closure with a transaction, if the closure returns an error the transaction will rollback, else it will be committed

pub fn close(self) -> Result<(), FbError>[src]

Close the current connection

Trait Implementations

impl<C> Drop for Connection<C> where
    C: FirebirdClient
[src]

impl<C> Execute for Connection<C> where
    C: FirebirdClient
[src]

fn execute<P>(&mut self, sql: &str, params: P) -> Result<(), FbError> where
    P: IntoParams
[src]

Prepare, execute and commit the sql query

Use () for no parameters or a tuple of parameters

impl<C> Queryable for Connection<C> where
    C: FirebirdClient
[src]

fn query_iter<'a, P, R>(
    &'a mut self,
    sql: &str,
    params: P
) -> Result<Box<dyn Iterator<Item = Result<R, FbError>> + 'a>, FbError> where
    P: IntoParams,
    R: FromRow + 'static, 
[src]

Prepare, execute, return the rows and commit the sql query

Use () for no parameters or a tuple of parameters

Auto Trait Implementations

impl<C> !RefUnwindSafe for Connection<C>

impl<C> Send for Connection<C> where
    <C as FirebirdClient>::DbHandle: Send,
    <C as FirebirdClient>::StmtHandle: Send

impl<C> !Sync for Connection<C>

impl<C> Unpin for Connection<C> where
    C: Unpin,
    <C as FirebirdClient>::DbHandle: Unpin

impl<C> UnwindSafe for Connection<C> where
    C: UnwindSafe,
    <C as FirebirdClient>::DbHandle: UnwindSafe,
    <C as FirebirdClient>::StmtHandle: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.