pub struct FieldDecimal<const PRECISION: u8, const SCALE: u8>(pub Decimal);Tuple Fields§
§0: DecimalImplementations§
Source§impl<const P: u8, const S: u8> FieldDecimal<P, S>
impl<const P: u8, const S: u8> FieldDecimal<P, S>
Sourcepub fn from_decimal(value: Decimal) -> Self
pub fn from_decimal(value: Decimal) -> Self
Wraps value at the column scale (12.5 becomes 12.50 for FieldDecimal<10, 2>),
so a value read back has the same digits the database stores.
Trait Implementations§
Source§impl<'de, const PRECISION: u8, const SCALE: u8> Deserialize<'de> for FieldDecimal<PRECISION, SCALE>
impl<'de, const PRECISION: u8, const SCALE: u8> Deserialize<'de> for FieldDecimal<PRECISION, SCALE>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<const P: u8, const S: u8> FilterValue<FieldDecimal<P, S>> for Decimal
impl<const P: u8, const S: u8> FilterValue<FieldDecimal<P, S>> for Decimal
fn into_sql_value(self) -> SqlValue
impl<const PRECISION: u8, const SCALE: u8> StructuralPartialEq for FieldDecimal<PRECISION, SCALE>
Source§impl<const P: u8, const S: u8> ToSqlValue for FieldDecimal<P, S>
impl<const P: u8, const S: u8> ToSqlValue for FieldDecimal<P, S>
fn to_sql_value(&self) -> SqlValue
Auto Trait Implementations§
impl<const PRECISION: u8, const SCALE: u8> Forget for FieldDecimal<PRECISION, SCALE>
impl<const PRECISION: u8, const SCALE: u8> Freeze for FieldDecimal<PRECISION, SCALE>
impl<const PRECISION: u8, const SCALE: u8> RefUnwindSafe for FieldDecimal<PRECISION, SCALE>
impl<const PRECISION: u8, const SCALE: u8> Send for FieldDecimal<PRECISION, SCALE>
impl<const PRECISION: u8, const SCALE: u8> Sync for FieldDecimal<PRECISION, SCALE>
impl<const PRECISION: u8, const SCALE: u8> Unpin for FieldDecimal<PRECISION, SCALE>
impl<const PRECISION: u8, const SCALE: u8> UnsafeUnpin for FieldDecimal<PRECISION, SCALE>
impl<const PRECISION: u8, const SCALE: u8> UnwindSafe for FieldDecimal<PRECISION, SCALE>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more