pub struct StatementImpl<'s> { /* private fields */ }
Expand description
An owned valid (i.e. successfully allocated) ODBC statement handle. StatementImpl
borrows
the parent connection used to create the handle in order to ensure the Parent is alive and valid
during the lifetime of the statement.
If you want a handle to the statement that instead of borrowing the parent connection does own
it, you should use super::StatementConnection
instead.
Implementations§
Source§impl StatementImpl<'_>
impl StatementImpl<'_>
Sourcepub unsafe fn new(handle: HStmt) -> Self
pub unsafe fn new(handle: HStmt) -> Self
§Safety
handle
must be a valid (successfully allocated) statement handle.
Sourcepub fn into_sys(self) -> HStmt
pub fn into_sys(self) -> HStmt
Transfer ownership of this statement to a raw system handle. It is the users responsibility
to call crate::sys::SQLFreeHandle
.
Sourcepub fn as_stmt_ref(&mut self) -> StatementRef<'_>
pub fn as_stmt_ref(&mut self) -> StatementRef<'_>
Special wrapper to a borrowed statement. Acts like a mutable reference to an owned statement, but allows the lifetime of the tracked connection to stay covariant.
Trait Implementations§
Source§impl AnyHandle for StatementImpl<'_>
impl AnyHandle for StatementImpl<'_>
Source§fn as_handle(&self) -> Handle
fn as_handle(&self) -> Handle
Source§fn handle_type(&self) -> HandleType
fn handle_type(&self) -> HandleType
as_handle
. This is a method rather than a constant
in order to make the type object safe.Source§impl AsStatementRef for &mut StatementImpl<'_>
impl AsStatementRef for &mut StatementImpl<'_>
Source§fn as_stmt_ref(&mut self) -> StatementRef<'_>
fn as_stmt_ref(&mut self) -> StatementRef<'_>
Source§impl AsStatementRef for StatementImpl<'_>
impl AsStatementRef for StatementImpl<'_>
Source§fn as_stmt_ref(&mut self) -> StatementRef<'_>
fn as_stmt_ref(&mut self) -> StatementRef<'_>
Source§impl<'s> Debug for StatementImpl<'s>
impl<'s> Debug for StatementImpl<'s>
Source§impl Drop for StatementImpl<'_>
impl Drop for StatementImpl<'_>
Source§impl Statement for StatementImpl<'_>
impl Statement for StatementImpl<'_>
Source§fn as_sys(&self) -> HStmt
fn as_sys(&self) -> HStmt
Gain access to the underlying statement handle without transferring ownership to it.
Source§unsafe fn bind_col(
&mut self,
column_number: u16,
target: &mut impl CDataMut,
) -> SqlResult<()>
unsafe fn bind_col( &mut self, column_number: u16, target: &mut impl CDataMut, ) -> SqlResult<()>
Source§unsafe fn fetch(&mut self) -> SqlResult<()>
unsafe fn fetch(&mut self) -> SqlResult<()>
Source§fn get_data(
&mut self,
col_or_param_num: u16,
target: &mut impl CDataMut,
) -> SqlResult<()>
fn get_data( &mut self, col_or_param_num: u16, target: &mut impl CDataMut, ) -> SqlResult<()>
Source§fn unbind_cols(&mut self) -> SqlResult<()>
fn unbind_cols(&mut self) -> SqlResult<()>
bind_col
. Except bookmark column.Source§unsafe fn set_num_rows_fetched(&mut self, num_rows: &mut usize) -> SqlResult<()>
unsafe fn set_num_rows_fetched(&mut self, num_rows: &mut usize) -> SqlResult<()>
Self::unset_num_rows_fetched
is going to unbind the value from the statement. Read moreSource§fn set_query_timeout_sec(&mut self, timeout_sec: usize) -> SqlResult<()>
fn set_query_timeout_sec(&mut self, timeout_sec: usize) -> SqlResult<()>
timeout_sec
is 0
(default), there is no timeout. Read moreSource§fn query_timeout_sec(&mut self) -> SqlResult<usize>
fn query_timeout_sec(&mut self) -> SqlResult<usize>
timeout_sec
is 0
(default), there is no timeout. Read moreSource§fn unset_num_rows_fetched(&mut self) -> SqlResult<()>
fn unset_num_rows_fetched(&mut self) -> SqlResult<()>
Self::set_num_rows_fetched
. Read moreSource§fn describe_col(
&mut self,
column_number: u16,
column_description: &mut ColumnDescription,
) -> SqlResult<()>
fn describe_col( &mut self, column_number: u16, column_description: &mut ColumnDescription, ) -> SqlResult<()>
Source§unsafe fn exec_direct(&mut self, statement: &SqlText<'_>) -> SqlResult<()>
unsafe fn exec_direct(&mut self, statement: &SqlText<'_>) -> SqlResult<()>
Source§fn close_cursor(&mut self) -> SqlResult<()>
fn close_cursor(&mut self) -> SqlResult<()>
Source§fn prepare(&mut self, statement: &SqlText<'_>) -> SqlResult<()>
fn prepare(&mut self, statement: &SqlText<'_>) -> SqlResult<()>
Source§unsafe fn execute(&mut self) -> SqlResult<()>
unsafe fn execute(&mut self) -> SqlResult<()>
prepare
. After the application processes or discards the
results from a call to execute
, the application can call SQLExecute again with new
parameter values. Read moreSource§fn num_params(&mut self) -> SqlResult<u16>
fn num_params(&mut self) -> SqlResult<u16>
Source§unsafe fn set_row_array_size(&mut self, size: usize) -> SqlResult<()>
unsafe fn set_row_array_size(&mut self, size: usize) -> SqlResult<()>
Source§fn row_array_size(&mut self) -> SqlResult<usize>
fn row_array_size(&mut self) -> SqlResult<usize>
Source§unsafe fn set_paramset_size(&mut self, size: usize) -> SqlResult<()>
unsafe fn set_paramset_size(&mut self, size: usize) -> SqlResult<()>
Source§unsafe fn set_row_bind_type(&mut self, row_size: usize) -> SqlResult<()>
unsafe fn set_row_bind_type(&mut self, row_size: usize) -> SqlResult<()>
fn set_metadata_id(&mut self, metadata_id: bool) -> SqlResult<()>
Source§fn set_async_enable(&mut self, on: bool) -> SqlResult<()>
fn set_async_enable(&mut self, on: bool) -> SqlResult<()>
Source§unsafe fn bind_input_parameter(
&mut self,
parameter_number: u16,
parameter: &(impl HasDataType + CData + ?Sized),
) -> SqlResult<()>
unsafe fn bind_input_parameter( &mut self, parameter_number: u16, parameter: &(impl HasDataType + CData + ?Sized), ) -> SqlResult<()>
Statement::bind_parameter
for the version which can bind
input and output parameters. Read moreSource§unsafe fn bind_parameter(
&mut self,
parameter_number: u16,
input_output_type: ParamType,
parameter: &mut (impl CDataMut + HasDataType),
) -> SqlResult<()>
unsafe fn bind_parameter( &mut self, parameter_number: u16, input_output_type: ParamType, parameter: &mut (impl CDataMut + HasDataType), ) -> SqlResult<()>
Statement::bind_input_parameter
. Read moreSource§unsafe fn bind_delayed_input_parameter(
&mut self,
parameter_number: u16,
parameter: &mut (impl DelayedInput + HasDataType),
) -> SqlResult<()>
unsafe fn bind_delayed_input_parameter( &mut self, parameter_number: u16, parameter: &mut (impl DelayedInput + HasDataType), ) -> SqlResult<()>
Statement::bind_input_parameter
. Read moreSource§fn is_unsigned_column(&mut self, column_number: u16) -> SqlResult<bool>
fn is_unsigned_column(&mut self, column_number: u16) -> SqlResult<bool>
true
if a given column in a result set is unsigned or not a numeric type, false
otherwise. Read moreSource§fn col_type(&mut self, column_number: u16) -> SqlResult<SqlDataType>
fn col_type(&mut self, column_number: u16) -> SqlResult<SqlDataType>
Source§fn col_concise_type(&mut self, column_number: u16) -> SqlResult<SqlDataType>
fn col_concise_type(&mut self, column_number: u16) -> SqlResult<SqlDataType>
TIME
or INTERVAL_YEAR
. Read moreSource§fn col_octet_length(&mut self, column_number: u16) -> SqlResult<isize>
fn col_octet_length(&mut self, column_number: u16) -> SqlResult<isize>
Source§fn col_display_size(&mut self, column_number: u16) -> SqlResult<isize>
fn col_display_size(&mut self, column_number: u16) -> SqlResult<isize>
Source§fn col_precision(&mut self, column_number: u16) -> SqlResult<isize>
fn col_precision(&mut self, column_number: u16) -> SqlResult<isize>
Source§fn col_scale(&mut self, column_number: u16) -> SqlResult<isize>
fn col_scale(&mut self, column_number: u16) -> SqlResult<isize>
Source§fn col_nullability(&mut self, column_number: u16) -> SqlResult<Nullability>
fn col_nullability(&mut self, column_number: u16) -> SqlResult<Nullability>
Source§fn col_name(
&mut self,
column_number: u16,
buffer: &mut Vec<SqlChar>,
) -> SqlResult<()>
fn col_name( &mut self, column_number: u16, buffer: &mut Vec<SqlChar>, ) -> SqlResult<()>
Source§unsafe fn numeric_col_attribute(
&mut self,
attribute: Desc,
column_number: u16,
) -> SqlResult<Len>
unsafe fn numeric_col_attribute( &mut self, attribute: Desc, column_number: u16, ) -> SqlResult<Len>
Source§fn reset_parameters(&mut self) -> SqlResult<()>
fn reset_parameters(&mut self) -> SqlResult<()>
Source§fn describe_param(
&mut self,
parameter_number: u16,
) -> SqlResult<ParameterDescription>
fn describe_param( &mut self, parameter_number: u16, ) -> SqlResult<ParameterDescription>
Source§fn param_data(&mut self) -> SqlResult<Option<Pointer>>
fn param_data(&mut self) -> SqlResult<Option<Pointer>>
crate::sys::DATA_AT_EXEC
or a value created with
crate::sys::len_data_at_exec
. Read moreSource§fn columns(
&mut self,
catalog_name: &SqlText<'_>,
schema_name: &SqlText<'_>,
table_name: &SqlText<'_>,
column_name: &SqlText<'_>,
) -> SqlResult<()>
fn columns( &mut self, catalog_name: &SqlText<'_>, schema_name: &SqlText<'_>, table_name: &SqlText<'_>, column_name: &SqlText<'_>, ) -> SqlResult<()>
Source§fn tables(
&mut self,
catalog_name: &SqlText<'_>,
schema_name: &SqlText<'_>,
table_name: &SqlText<'_>,
table_type: &SqlText<'_>,
) -> SqlResult<()>
fn tables( &mut self, catalog_name: &SqlText<'_>, schema_name: &SqlText<'_>, table_name: &SqlText<'_>, table_type: &SqlText<'_>, ) -> SqlResult<()>
Source§fn foreign_keys(
&mut self,
pk_catalog_name: &SqlText<'_>,
pk_schema_name: &SqlText<'_>,
pk_table_name: &SqlText<'_>,
fk_catalog_name: &SqlText<'_>,
fk_schema_name: &SqlText<'_>,
fk_table_name: &SqlText<'_>,
) -> SqlResult<()>
fn foreign_keys( &mut self, pk_catalog_name: &SqlText<'_>, pk_schema_name: &SqlText<'_>, pk_table_name: &SqlText<'_>, fk_catalog_name: &SqlText<'_>, fk_schema_name: &SqlText<'_>, fk_table_name: &SqlText<'_>, ) -> SqlResult<()>
Source§fn put_binary_batch(&mut self, batch: &[u8]) -> SqlResult<()>
fn put_binary_batch(&mut self, batch: &[u8]) -> SqlResult<()>
SqlResult::NeedData
Read moreSource§fn complete_async(
&mut self,
function_name: &'static str,
) -> SqlResult<SqlResult<()>>
fn complete_async( &mut self, function_name: &'static str, ) -> SqlResult<SqlResult<()>>
SqlResult::NoData
if no asynchronous operation is in progress, or (specific
to notification mode) the driver manager has not notified the application. Read moreSource§unsafe fn more_results(&mut self) -> SqlResult<()>
unsafe fn more_results(&mut self) -> SqlResult<()>
SqlResult::NoData
is returned to indicate that there are no more result sets. Read moreSource§fn application_row_descriptor(&mut self) -> SqlResult<Descriptor<'_>>
fn application_row_descriptor(&mut self) -> SqlResult<Descriptor<'_>>
Auto Trait Implementations§
impl<'s> Freeze for StatementImpl<'s>
impl<'s> RefUnwindSafe for StatementImpl<'s>
impl<'s> !Send for StatementImpl<'s>
impl<'s> !Sync for StatementImpl<'s>
impl<'s> Unpin for StatementImpl<'s>
impl<'s> UnwindSafe for StatementImpl<'s>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Diagnostics for T
impl<T> Diagnostics for T
Source§fn diagnostic_record(
&self,
rec_number: i16,
message_text: &mut [u8],
) -> Option<DiagnosticResult>
fn diagnostic_record( &self, rec_number: i16, message_text: &mut [u8], ) -> Option<DiagnosticResult>
Source§fn diagnostic_record_vec(
&self,
rec_number: i16,
message_text: &mut Vec<SqlChar>,
) -> Option<DiagnosticResult>
fn diagnostic_record_vec( &self, rec_number: i16, message_text: &mut Vec<SqlChar>, ) -> Option<DiagnosticResult>
Self::diagnostic_record
, if the message does not fit in the
buffer, it will grow the message buffer and extract it again. Read more