pub struct Statement { /* private fields */ }Expand description
v7.16.0 — handle for a parsed-and-planned SQL statement.
Hand off to Database::execute_prepared / Database::query_prepared
with a &[Value] slice carrying the bind parameters (PG-style
$1, $2, … positional). Cheap to Clone; the underlying AST
is shared by handle copies and cloned per bind call by the
engine’s executor.
The handle holds a snapshot of the AST at prepare time. If
the engine’s plan cache evicts the entry between prepare and
execute (e.g. ANALYZE bumps the statistics version) the
stored AST keeps working — execute_prepared operates on
the handle’s clone, not the cache entry.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnsafeUnpin for Statement
impl UnwindSafe for Statement
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