Struct odbc_api::CursorImpl
source · [−]pub struct CursorImpl<Stmt: BorrowMutStatement> { /* private fields */ }
Expand description
Cursors are used to process and iterate the result sets returned by executing queries. Created
by either a prepared query or direct execution. Usually utilized through the crate::Cursor
trait.
Implementations
sourceimpl<S> CursorImpl<S> where
S: BorrowMutStatement,
impl<S> CursorImpl<S> where
S: BorrowMutStatement,
sourcepub unsafe fn new(statement: S) -> Self
pub unsafe fn new(statement: S) -> Self
Users of this library are encouraged not to call this constructor directly but rather invoke
crate::Connection::execute
or crate::Prepared::execute
to get a cursor and utilize
it using the crate::Cursor
trait. This method is pubilc so users with an understanding
of the raw ODBC C-API have a way to create a cursor, after they left the safety rails of the
Rust type System, in order to implement a use case not covered yet, by the safe abstractions
within this crate.
Safety
statement
must be in Cursor state, for the invariants of this type to hold.
Trait Implementations
sourceimpl<S> Cursor for CursorImpl<S> where
S: BorrowMutStatement,
impl<S> Cursor for CursorImpl<S> where
S: BorrowMutStatement,
sourceunsafe fn stmt_mut(&mut self) -> &mut Self::Statement
unsafe fn stmt_mut(&mut self) -> &mut Self::Statement
Provides access to the underlying statement handle. Read more
sourcefn bind_buffer<B>(
self,
row_set_buffer: B
) -> Result<RowSetCursor<Self, B>, Error> where
B: RowSetBuffer,
fn bind_buffer<B>(
self,
row_set_buffer: B
) -> Result<RowSetCursor<Self, B>, Error> where
B: RowSetBuffer,
Binds this cursor to a buffer holding a row set.
sourceimpl<'o, S> Drop for CursorImpl<S> where
S: BorrowMutStatement,
impl<'o, S> Drop for CursorImpl<S> where
S: BorrowMutStatement,
sourceimpl<S> ResultSetMetadata for CursorImpl<S> where
S: BorrowMutStatement,
impl<S> ResultSetMetadata for CursorImpl<S> where
S: BorrowMutStatement,
type Statement = S::Statement
type Statement = S::Statement
Statement type of the cursor. This is always an instantiation of
crate::handles::Statement
with a generic parameter indicating the lifetime of the
associated connection. Read more
sourcefn stmt_ref(&self) -> &Self::Statement
fn stmt_ref(&self) -> &Self::Statement
Get a shared reference to the underlying statement handle. This method is used to implement
other more high level methods like Self::describe_col
on top of it. It is usually not
intended to be called by users of this library directly, but may serve as an escape hatch
for low level usecases. Read more
sourcefn describe_col(
&self,
column_number: u16,
column_description: &mut ColumnDescription
) -> Result<(), Error>
fn describe_col(
&self,
column_number: u16,
column_description: &mut ColumnDescription
) -> Result<(), Error>
Fetch a column description using the column index. Read more
sourcefn num_result_cols(&self) -> Result<i16, Error>
fn num_result_cols(&self) -> Result<i16, Error>
Number of columns in result set. Can also be used to see wether execting a prepared
Statement (crate::Prepared
) would yield a result set, as this would return 0
if it
does not. Read more
sourcefn is_unsigned_column(&self, column_number: u16) -> Result<bool, Error>
fn is_unsigned_column(&self, column_number: u16) -> Result<bool, Error>
true
if a given column in a result set is unsigned or not a numeric type, false
otherwise. Read more
sourcefn col_octet_length(&self, column_number: u16) -> Result<isize, Error>
fn col_octet_length(&self, column_number: u16) -> Result<isize, Error>
Returns the size in bytes of the columns. For variable sized types the maximum size is returned, excluding a terminating zero. Read more
sourcefn col_display_size(&self, column_number: u16) -> Result<isize, Error>
fn col_display_size(&self, column_number: u16) -> Result<isize, Error>
Maximum number of characters required to display data from the column. Read more
sourcefn col_precision(&self, column_number: u16) -> Result<isize, Error>
fn col_precision(&self, column_number: u16) -> Result<isize, Error>
Precision of the column. Read more
sourcefn col_scale(&self, column_number: u16) -> Result<isize, Error>
fn col_scale(&self, column_number: u16) -> Result<isize, Error>
The applicable scale for a numeric data type. For DECIMAL and NUMERIC data types, this is the defined scale. It is undefined for all other data types. Read more
sourcefn col_name(&self, column_number: u16) -> Result<String, Error>
fn col_name(&self, column_number: u16) -> Result<String, Error>
The column alias, if it applies. If the column alias does not apply, the column name is returned. If there is no column name or a column alias, an empty string is returned. Read more
sourcefn column_names(&self) -> Result<ColumnNamesIt<'_, Self>, Error>
fn column_names(&self) -> Result<ColumnNamesIt<'_, Self>, Error>
Use this if you want to iterate over all column names and allocate a String
for each one. Read more
Auto Trait Implementations
impl<Stmt> RefUnwindSafe for CursorImpl<Stmt> where
Stmt: RefUnwindSafe,
impl<Stmt> Send for CursorImpl<Stmt> where
Stmt: Send,
impl<Stmt> Sync for CursorImpl<Stmt> where
Stmt: Sync,
impl<Stmt> Unpin for CursorImpl<Stmt> where
Stmt: Unpin,
impl<Stmt> UnwindSafe for CursorImpl<Stmt> where
Stmt: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more