Struct Connection

Source
pub struct Connection<'env, AC: AutocommitMode> { /* private fields */ }
Expand description

Represents a connection to an ODBC data source

Implementations§

Source§

impl<'env> Connection<'env, AutocommitOn>

Source§

impl<'env> Connection<'env, AutocommitOff>

Source

pub fn enable_autocommit(self) -> Result<Connection<'env, AutocommitOn>, Self>

Source

pub fn commit(&mut self) -> Result<()>

Source

pub fn rollback(&mut self) -> Result<()>

Source§

impl<'env, AC: AutocommitMode> Connection<'env, AC>

Source

pub fn is_read_only(&mut self) -> Result<bool>

true if the data source is set to READ ONLY mode, false otherwise.

This characteristic pertains only to the data source itself; it is not characteristic of the driver that enables access to the data source. A driver that is read/write can be used with a data source that is read-only. If a driver is read-only, all of its data sources must be read-only.

Source

pub fn disconnect(self) -> Result<()>

Closes the connection to the data source. If not called explicitly the disconnect will be invoked implicitly by drop()

Trait Implementations§

Source§

impl<'env, AC: Debug + AutocommitMode> Debug for Connection<'env, AC>

Source§

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

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

impl<'env, AC: AutocommitMode> Handle for Connection<'env, AC>

Source§

type To = Dbc

Source§

unsafe fn handle(&self) -> SQLHDBC

Returns a valid handle to the odbc type.
Source§

impl<'env, AC: AutocommitMode> Handle for Connection<'env, AC>

Source§

const HANDLE_TYPE: HandleType = ffi::SQL_HANDLE_DBC

Used to identify the type of the handle in various functions of the ODBC C interface
Source§

fn handle(&self) -> SQLHANDLE

Returns a ptr to the wrapped ODBC Object

Auto Trait Implementations§

§

impl<'env, AC> Freeze for Connection<'env, AC>

§

impl<'env, AC> RefUnwindSafe for Connection<'env, AC>
where AC: RefUnwindSafe,

§

impl<'env, AC> !Send for Connection<'env, AC>

§

impl<'env, AC> !Sync for Connection<'env, AC>

§

impl<'env, AC> Unpin for Connection<'env, AC>
where AC: Unpin,

§

impl<'env, AC> UnwindSafe for Connection<'env, AC>
where AC: UnwindSafe,

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<H> Diagnostics for H
where H: Handle,

Source§

fn diagnostics( &self, rec_number: i16, message_text: &mut [u8], ) -> ReturnOption<DiagResult>

Returns the current values of multiple fields of a diagnostic record that contains error, warning, and status information. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<D> GetDiagRec for D
where D: Diagnostics,

Source§

fn get_diag_rec(&self, record_number: i16) -> Option<DiagnosticRecord>

Retrieves a diagnostic record Read more
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>,

Source§

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>,

Source§

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.