toasty_core/schema/app/arg.rs
1use crate::stmt;
2
3/// A named, typed argument used in query parameterization.
4///
5/// `Arg` represents a single parameter that can be passed into a query
6/// statement. Each argument has a name for identification and a type that
7/// determines what values it accepts.
8///
9/// # Examples
10///
11/// ```
12/// use toasty_core::schema::app::Arg;
13/// use toasty_core::stmt::Type;
14///
15/// let arg = Arg {
16/// name: "user_id".to_string(),
17/// ty: Type::String,
18/// };
19/// assert_eq!(arg.name, "user_id");
20/// ```
21#[derive(Debug, Clone)]
22pub struct Arg {
23 /// The argument's name, used to identify it in queries.
24 pub name: String,
25
26 /// The statement type this argument accepts.
27 pub ty: stmt::Type,
28}