pub struct ParamBind<'a, V>where
V: SQLParam,{
pub name: &'a str,
pub value: V,
}Expand description
A value to bind to the placeholder called name.
Pass these to SQL::bind or to a prepared
statement. TypedPlaceholder::bind
creates one with a type check.
§Examples
use drizzle_core::{ParamBind, Placeholder, SQL, ToSQL};
let sql: SQL<'_, Value> = Placeholder::named("limit").to_sql();
let bound = sql.bind([ParamBind::new("limit", Value(20))]);
assert_eq!(bound.params().collect::<Vec<_>>(), [&Value(20)]);Fields§
§name: &'a strThe placeholder name. Empty for a positional binding.
value: VThe value to bind.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a, V> Freeze for ParamBind<'a, V>where
V: Freeze,
impl<'a, V> RefUnwindSafe for ParamBind<'a, V>where
V: RefUnwindSafe,
impl<'a, V> Send for ParamBind<'a, V>where
V: Send,
impl<'a, V> Sync for ParamBind<'a, V>where
V: Sync,
impl<'a, V> Unpin for ParamBind<'a, V>where
V: Unpin,
impl<'a, V> UnsafeUnpin for ParamBind<'a, V>where
V: UnsafeUnpin,
impl<'a, V> UnwindSafe for ParamBind<'a, V>where
V: UnwindSafe,
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