pub(crate) struct Modifiers {Show 16 fields
is_monotone: Option<Expr>,
is_infinity_monotone: Option<Expr>,
sqlname: Option<SqlName>,
preserves_uniqueness: Option<Expr>,
inverse: Option<Expr>,
negate: Option<Expr>,
is_infix_op: Option<Expr>,
output_type: Option<Path>,
output_type_expr: Option<Expr>,
could_error: Option<Expr>,
propagates_nulls: Option<Expr>,
introduces_nulls: Option<Expr>,
is_associative: Option<Expr>,
is_eliminable_cast: Option<Expr>,
test: Option<bool>,
skip_display: Option<bool>,
}Expand description
Modifiers passed as key-value pairs to the #[sqlfunc] macro.
Fields§
§is_monotone: Option<Expr>Whether the function is monotone with respect to its arguments. Binary functions take a pair of expressions, one per argument.
is_infinity_monotone: Option<Expr>Whether is_monotone’s endpoint-sampling guarantee still holds when an operand
may be infinite. Set false for multiplication and division.
sqlname: Option<SqlName>The SQL name for the function.
preserves_uniqueness: Option<Expr>Whether the function preserves uniqueness.
inverse: Option<Expr>The inverse of the function, if it exists.
negate: Option<Expr>The negated function, if it exists.
is_infix_op: Option<Expr>Whether the function is an infix operator.
output_type: Option<Path>The output type of the function, if it cannot be inferred.
output_type_expr: Option<Expr>The output type of the function as an expression.
could_error: Option<Expr>Whether the function could error.
propagates_nulls: Option<Expr>Whether the function propagates nulls.
introduces_nulls: Option<Expr>Whether the function introduces nulls.
is_associative: Option<Expr>Whether the function is associative.
is_eliminable_cast: Option<Expr>Whether the function is a noop cast.
test: Option<bool>Whether to generate a snapshot test for the function. Defaults to false.
skip_display: Option<bool>Suppresses the generated fmt::Display. Set this when the struct’s name
depends on its state, so the call site keeps a hand-written impl.
Implementations§
Source§impl Modifiers
impl Modifiers
Sourcepub(crate) fn generates_test(&self) -> bool
pub(crate) fn generates_test(&self) -> bool
Whether the call site asked for a generated snapshot test.
Sourcepub(crate) fn sqlname(&self) -> Option<&SqlName>
pub(crate) fn sqlname(&self) -> Option<&SqlName>
The SQL name the generated Display writes, if the call site overrides the
function’s name.
Sourcepub(crate) fn output_type(&self) -> Option<&Path>
pub(crate) fn output_type(&self) -> Option<&Path>
The type whose column type is the function’s output type, if the call site overrides the one derived from the return type.
Sourcepub(crate) fn output_type_expr(&self) -> Option<&Expr>
pub(crate) fn output_type_expr(&self) -> Option<&Expr>
An expression computing the function’s output column type, if the call site overrides the one derived from the return type.
Sourcepub(crate) fn skip_display(&self) -> bool
pub(crate) fn skip_display(&self) -> bool
Whether the call site asked to suppress the generated Display impl.
Trait Implementations§
Source§impl FromMeta for Modifiers
impl FromMeta for Modifiers
Source§fn from_list(__items: &[NestedMeta]) -> Result<Self>
fn from_list(__items: &[NestedMeta]) -> Result<Self>
fn from_nested_meta(item: &NestedMeta) -> Result<Self, Error>
Source§fn from_meta(item: &Meta) -> Result<Self, Error>
fn from_meta(item: &Meta) -> Result<Self, Error>
syn::Meta by dispatching to the format-appropriate
trait function. This generally should not be overridden by implementers. Read moreSource§fn from_none() -> Option<Self>
fn from_none() -> Option<Self>
from_none is used to attempt
recovery before a missing field error is generated. Read moreSource§fn from_word() -> Result<Self, Error>
fn from_word() -> Result<Self, Error>
Source§fn from_value(value: &Lit) -> Result<Self, Error>
fn from_value(value: &Lit) -> Result<Self, Error>
foo = "bar" or foo("bar").
This dispatches to the appropriate method based on the type of literal encountered,
and generally should not be overridden by implementers. Read more