pub struct Prebound<'open_connection, Parameters> { /* private fields */ }
Expand description
A prepared statement with prebound parameters.
Helps you avoid (potentially costly) ODBC function calls than repeatedly executing the same
prepared query with different parameters. Using this instead of crate::Prepared::execute
directly results in the parameter buffers only to be bound once and modified between calls,
instead of new buffers bound.
Implementations
sourceimpl<'o, P> Prebound<'o, P> where
P: ParameterMutCollection,
impl<'o, P> Prebound<'o, P> where
P: ParameterMutCollection,
sourcepub unsafe fn new(
statement: StatementImpl<'o>,
parameters: P
) -> Result<Self, Error>
pub unsafe fn new(
statement: StatementImpl<'o>,
parameters: P
) -> Result<Self, Error>
Safety
statement
must be a prepared statement.parameters
will be bound to statement. Must not be invalidated by moving. Nor should any operations which can be performed through a mutable reference be able to invalidate the bindings.
sourcepub fn execute(
&mut self
) -> Result<Option<CursorImpl<&mut StatementImpl<'o>>>, Error>
pub fn execute(
&mut self
) -> Result<Option<CursorImpl<&mut StatementImpl<'o>>>, Error>
Execute the prepared statement
sourcepub fn params_mut(&mut self) -> &mut P::Mut
pub fn params_mut(&mut self) -> &mut P::Mut
Provides write access to the bound parameters. Used to change arguments betwenn statement executions.
Auto Trait Implementations
impl<'open_connection, Parameters> RefUnwindSafe for Prebound<'open_connection, Parameters> where
Parameters: RefUnwindSafe,
impl<'open_connection, Parameters> !Send for Prebound<'open_connection, Parameters>
impl<'open_connection, Parameters> !Sync for Prebound<'open_connection, Parameters>
impl<'open_connection, Parameters> Unpin for Prebound<'open_connection, Parameters> where
Parameters: Unpin,
impl<'open_connection, Parameters> UnwindSafe for Prebound<'open_connection, Parameters> where
Parameters: 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