pub trait QueryArgs {
// Required method
fn to_params(&self) -> Vec<(&str, DecodedValue)>;
}Expand description
The collection of arguments a query method takes. &() when there are
none, a tuple for positional $0/$1/…, a HashMap or a slice of
(name, value) pairs for named ones.
Required Methods§
Sourcefn to_params(&self) -> Vec<(&str, DecodedValue)>
fn to_params(&self) -> Vec<(&str, DecodedValue)>
Borrows the names out of self (which the query method holds by
reference for the whole call) so only the values are cloned.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl QueryArgs for HashMap<&str, ValueOpt>
Keyed by ValueOpt rather than by any V: QueryArg, because
ValueOpt deliberately does not implement QueryArg: it is built from
one via a blanket From, and making it a QueryArg too would collide
with the standard library’s reflexive impl<T> From<T> for T.
impl QueryArgs for HashMap<&str, ValueOpt>
Keyed by ValueOpt rather than by any V: QueryArg, because
ValueOpt deliberately does not implement QueryArg: it is built from
one via a blanket From, and making it a QueryArg too would collide
with the standard library’s reflexive impl<T> From<T> for T.