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: PinnedParameterCollection,
impl<'o, P> Prebound<'o, P> where
P: PinnedParameterCollection,
sourcepub unsafe fn new(
statement: StatementImpl<'o>,
parameters: P
) -> Result<Self, Error>
pub unsafe fn new(
statement: StatementImpl<'o>,
parameters: P
) -> Result<Self, Error>
Avoid using this unsafe constructor. New instances of this are best constructed using
crate::Prepared::bind_parameters
.
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
sourceimpl<'o, P> Prebound<'o, P>
impl<'o, P> Prebound<'o, P>
sourcepub fn params_mut<'a>(&'a mut self) -> P::ViewMut where
P: ViewPinnedMut<'a, 'o>,
pub fn params_mut<'a>(&'a mut self) -> P::ViewMut where
P: ViewPinnedMut<'a, 'o>,
Provides write access to the bound parameters. Used to change arguments between 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