Struct rsfbclient::Connection[][src]

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

A connection to a firebird database

Implementations

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

pub fn open(
    cli: C,
    conf: &ConnectionConfiguration<C::AttachmentConfig>
) -> Result<Connection<C>, FbError>
[src]

Open the client connection.

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

Drop the current database

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

Close the current connection.

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

Run a closure with a transaction, if the closure returns an error and the default transaction is not active, the transaction will rollback, else it will be committed

pub fn begin_transaction(&mut self) -> Result<(), FbError>[src]

Begins a new transaction, and instructs all the query and execute methods performed in the Connection type to not automatically commit and rollback until commit or rollback are called

pub fn commit(&mut self) -> Result<(), FbError>[src]

Commit the default transaction

pub fn rollback(&mut self) -> Result<(), FbError>[src]

Rollback the default transaction

Trait Implementations

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

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

impl From<Connection<NativeFbClient<DynLink>>> for SimpleConnection[src]

impl From<Connection<NativeFbClient<DynLoad>>> for SimpleConnection[src]

impl From<Connection<RustFbClient>> for SimpleConnection[src]

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

impl TryFrom<SimpleConnection> for Connection<NativeFbClient<DynLink>>[src]

type Error = FbError

The type returned in the event of a conversion error.

impl TryFrom<SimpleConnection> for Connection<NativeFbClient<DynLoad>>[src]

type Error = FbError

The type returned in the event of a conversion error.

impl TryFrom<SimpleConnection> for Connection<RustFbClient>[src]

type Error = FbError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<C> RefUnwindSafe for Connection<C> where
    C: RefUnwindSafe,
    <C as FirebirdClientDbOps>::DbHandle: RefUnwindSafe,
    <C as FirebirdClientSqlOps>::StmtHandle: RefUnwindSafe,
    <C as FirebirdClientSqlOps>::TrHandle: RefUnwindSafe

impl<C> Send for Connection<C>

impl<C> Sync for Connection<C> where
    C: Sync,
    <C as FirebirdClientDbOps>::DbHandle: Sync,
    <C as FirebirdClientSqlOps>::StmtHandle: Sync,
    <C as FirebirdClientSqlOps>::TrHandle: Sync

impl<C> Unpin for Connection<C> where
    C: Unpin,
    <C as FirebirdClientDbOps>::DbHandle: Unpin,
    <C as FirebirdClientSqlOps>::TrHandle: Unpin

impl<C> UnwindSafe for Connection<C> where
    C: UnwindSafe,
    <C as FirebirdClientDbOps>::DbHandle: UnwindSafe,
    <C as FirebirdClientSqlOps>::StmtHandle: RefUnwindSafe,
    <C as FirebirdClientSqlOps>::TrHandle: UnwindSafe

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> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,