pub trait Numeric {
// Required method
fn one() -> Value;
}Expand description
A numeric type that has a representable “one” value.
Used as a bound on crate::stmt::increment and crate::stmt::decrement
so the literal 1 is encoded as a stmt::Value variant matching the
field type — both backend binding and driver-side arithmetic require it.
Implemented for every primitive numeric type (i8–i64, u8–u64,
f32, f64). Implement for custom newtypes around supported numeric
values (e.g. wrapping rust_decimal::Decimal) to use them with
increment / decrement.
Required Methods§
Sourcefn one() -> Value
fn one() -> Value
Return the value 1 for this type as a stmt::Value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".