pub struct Parameters { /* private fields */ }Expand description
What a prepared statement was handed, by identifier.
A parameter is written ?, ?1, $1 or $name, and the parser gives every one of them an
identifier: the number for a positional parameter, the word for a named one, and the position
for a bare ?. So a set of values is a list of identifier and value pairs whatever the statement
was written with, and there is one lookup rather than two.
A list rather than a map. There are a handful of parameters in a statement, never a thousand, and keeping the order they were given in is worth more here than a hash: it is what the error about unused values lists them in.
Implementations§
Source§impl Parameters
impl Parameters
Sourcepub fn positional(values: Vec<Value>) -> Self
pub fn positional(values: Vec<Value>) -> Self
Values by position, numbered from one, which is what ? and $1 want.
Sourcepub fn set(&mut self, name: impl Into<String>, value: Value)
pub fn set(&mut self, name: impl Into<String>, value: Value)
Gives one parameter a value, replacing whatever it had.
Trait Implementations§
Source§impl Clone for Parameters
impl Clone for Parameters
Source§fn clone(&self) -> Parameters
fn clone(&self) -> Parameters
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Parameters
impl Debug for Parameters
Source§impl Default for Parameters
impl Default for Parameters
Source§fn default() -> Parameters
fn default() -> Parameters
Returns the “default value” for a type. Read more
Source§impl PartialEq for Parameters
impl PartialEq for Parameters
impl StructuralPartialEq for Parameters
Auto Trait Implementations§
impl Freeze for Parameters
impl RefUnwindSafe for Parameters
impl Send for Parameters
impl Sync for Parameters
impl Unpin for Parameters
impl UnsafeUnpin for Parameters
impl UnwindSafe for Parameters
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