pub struct StatementGuarded<'a, C>where
C: Query,{ /* private fields */ }
Expand description
Implementations§
Methods from Deref<Target = Statement>§
Sourcepub fn bind<P>(&self, params: P) -> StatementQuery<'_, P>where
P: AsParams,
pub fn bind<P>(&self, params: P) -> StatementQuery<'_, P>where
P: AsParams,
bind self to typed value parameters where they are encoded into a valid sql query in binary format
§Examples
// prepare a statement with typed parameters.
let stmt = Statement::named("SELECT * FROM users WHERE id = $1 AND age = $2", &[Type::INT4, Type::INT4])
.execute(&cli).await?;
// bind statement to typed value parameters and start query
let row_stream = stmt.bind([9527_i32, 18]).query(&cli).await?;
Sourcepub fn bind_dyn<'p, 't>(
&self,
params: &'p [&'t (dyn ToSql + Sync)],
) -> StatementQuery<'_, impl ExactSizeIterator<Item = &'t (dyn ToSql + Sync)> + 'p>
pub fn bind_dyn<'p, 't>( &self, params: &'p [&'t (dyn ToSql + Sync)], ) -> StatementQuery<'_, impl ExactSizeIterator<Item = &'t (dyn ToSql + Sync)> + 'p>
Statement::bind for dynamic typed parameters
§Examples
// bind to a dynamic typed slice where items have it's own concrete type.
let bind = statement.bind_dyn(&[&9527i32, &"nobody"]);
Trait Implementations§
Source§impl<C> Deref for StatementGuarded<'_, C>where
C: Query,
impl<C> Deref for StatementGuarded<'_, C>where
C: Query,
Auto Trait Implementations§
impl<'a, C> Freeze for StatementGuarded<'a, C>
impl<'a, C> RefUnwindSafe for StatementGuarded<'a, C>where
C: RefUnwindSafe,
impl<'a, C> Send for StatementGuarded<'a, C>where
C: Sync,
impl<'a, C> Sync for StatementGuarded<'a, C>where
C: Sync,
impl<'a, C> Unpin for StatementGuarded<'a, C>
impl<'a, C> UnwindSafe for StatementGuarded<'a, C>where
C: RefUnwindSafe,
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