Macro mysql_async::prelude::params

source ·
macro_rules! params {
    () => { ... };
    (@to_pair $map:expr, $name:expr => $value:expr) => { ... };
    (@to_pair $map:expr, $name:ident) => { ... };
    (@expand $map:expr;) => { ... };
    (@expand $map:expr; $name:expr => $value:expr, $($tail:tt)*) => { ... };
    (@expand $map:expr; $name:expr => $value:expr $(, $tail:tt)*) => { ... };
    (@expand $map:expr; $name:ident, $($tail:tt)*) => { ... };
    (@expand $map:expr; $name:ident $(, $tail:tt)*) => { ... };
    ($i:ident, $($tail:tt)*) => { ... };
    ($i:expr => $($tail:tt)*) => { ... };
    ($i:ident) => { ... };
}
Expand description

This macro is a convenient way to pass named parameters to a statement.

let foo = 42;
conn.prep_exec("SELECT :foo, :foo2x", params! {
    foo,
    "foo2x" => foo * 2,
});