pub struct PreparedStatement {
pub statement_id: u32,
pub sql: String,
pub params: Vec<ColumnDef>,
pub columns: Vec<ColumnDef>,
}Expand description
A prepared statement with its metadata.
Holds the server-assigned statement ID and column definitions for both parameters and result columns.
Fields§
§statement_id: u32Server-assigned statement ID
sql: StringSQL query (for debugging/logging)
params: Vec<ColumnDef>Parameter column definitions
columns: Vec<ColumnDef>Result column definitions
Implementations§
Source§impl PreparedStatement
impl PreparedStatement
Sourcepub fn new(
statement_id: u32,
sql: String,
params: Vec<ColumnDef>,
columns: Vec<ColumnDef>,
) -> Self
pub fn new( statement_id: u32, sql: String, params: Vec<ColumnDef>, columns: Vec<ColumnDef>, ) -> Self
Create a new prepared statement from prepare response.
Sourcepub fn param_count(&self) -> usize
pub fn param_count(&self) -> usize
Get the number of parameters expected.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Get the number of result columns.
Trait Implementations§
Source§impl Clone for PreparedStatement
impl Clone for PreparedStatement
Source§fn clone(&self) -> PreparedStatement
fn clone(&self) -> PreparedStatement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PreparedStatement
impl RefUnwindSafe for PreparedStatement
impl Send for PreparedStatement
impl Sync for PreparedStatement
impl Unpin for PreparedStatement
impl UnwindSafe for PreparedStatement
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).