pub struct FixedDecimal<const WIDTH: u8, const SCALE: u8>(pub Decimal);Expand description
Decimal wrapper enforcing static precision/scale.
WIDTH = total digits, SCALE = fractional digits.
Tuple Fields§
§0: DecimalTrait Implementations§
Source§impl<const WIDTH: u8, const SCALE: u8> Clone for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> Clone for FixedDecimal<WIDTH, SCALE>
Source§fn clone(&self) -> FixedDecimal<WIDTH, SCALE>
fn clone(&self) -> FixedDecimal<WIDTH, SCALE>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<const WIDTH: u8, const SCALE: u8> Copy for FixedDecimal<WIDTH, SCALE>
Source§impl<const WIDTH: u8, const SCALE: u8> Default for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> Default for FixedDecimal<WIDTH, SCALE>
Source§fn default() -> FixedDecimal<WIDTH, SCALE>
fn default() -> FixedDecimal<WIDTH, SCALE>
Returns the “default value” for a type. Read more
impl<const WIDTH: u8, const SCALE: u8> Eq for FixedDecimal<WIDTH, SCALE>
Source§impl<const W: u8, const S: u8> Expression for FixedDecimal<W, S>
impl<const W: u8, const S: u8> Expression for FixedDecimal<W, S>
Source§fn write_query(
&self,
writer: &dyn SqlWriter,
context: &mut Context,
out: &mut DynQuery,
)
fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, )
Generates the SQL representation of this expression.
Source§fn accept_visitor(
&self,
_matcher: &mut dyn ExpressionVisitor,
_writer: &dyn SqlWriter,
_context: &mut Context,
_out: &mut DynQuery,
) -> bool
fn accept_visitor( &self, _matcher: &mut dyn ExpressionVisitor, _writer: &dyn SqlWriter, _context: &mut Context, _out: &mut DynQuery, ) -> bool
Traverses the expression with a visitor. Read more
Source§fn as_identifier(&self, context: &mut Context) -> String
fn as_identifier(&self, context: &mut Context) -> String
Renders the expression as a string suitable for use as an identifier.
Source§impl<const W: u8, const S: u8> From<FixedDecimal<W, S>> for Decimal
impl<const W: u8, const S: u8> From<FixedDecimal<W, S>> for Decimal
Source§fn from(value: FixedDecimal<W, S>) -> Self
fn from(value: FixedDecimal<W, S>) -> Self
Converts to this type from the input type.
Source§impl<const W: u8, const S: u8> OpPrecedence for FixedDecimal<W, S>
impl<const W: u8, const S: u8> OpPrecedence for FixedDecimal<W, S>
Source§fn precedence(&self, _: &dyn SqlWriter) -> i32
fn precedence(&self, _: &dyn SqlWriter) -> i32
Lower numbers bind weaker, writers parenthesize when child precedence <= operator precedence.
Source§impl<const WIDTH: u8, const SCALE: u8> Ord for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> Ord for FixedDecimal<WIDTH, SCALE>
Source§fn cmp(&self, other: &FixedDecimal<WIDTH, SCALE>) -> Ordering
fn cmp(&self, other: &FixedDecimal<WIDTH, SCALE>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<const WIDTH: u8, const SCALE: u8> PartialEq for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> PartialEq for FixedDecimal<WIDTH, SCALE>
Source§fn eq(&self, other: &FixedDecimal<WIDTH, SCALE>) -> bool
fn eq(&self, other: &FixedDecimal<WIDTH, SCALE>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<const WIDTH: u8, const SCALE: u8> PartialOrd for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> PartialOrd for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> StructuralPartialEq for FixedDecimal<WIDTH, SCALE>
Auto Trait Implementations§
impl<const WIDTH: u8, const SCALE: u8> Freeze for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> RefUnwindSafe for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> Send for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> Sync for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> Unpin for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> UnsafeUnpin for FixedDecimal<WIDTH, SCALE>
impl<const WIDTH: u8, const SCALE: u8> UnwindSafe for FixedDecimal<WIDTH, 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