UnsignedDecimal

Struct UnsignedDecimal 

Source
pub struct UnsignedDecimal<const N: usize>(/* private fields */);
Expand description

§Unsigned Decimal

Generic unsigned N-bits decimal number.

Implementations§

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn from_u8(n: u8) -> Self

Converts u8 to Decimal.

Source

pub const fn from_u16(n: u16) -> Self

Converts u16 to Decimal.

Source

pub const fn from_u32(n: u32) -> Self

Converts u32 to Decimal.

Source

pub const fn from_u64(n: u64) -> Self

Converts u64 to Decimal.

Source

pub const fn from_u128(n: u128) -> Result<Self, ParseError>

Converts u128 to Decimal.

Source

pub const fn from_usize(n: usize) -> Self

Converts usize to Decimal.

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn from_i8(int: i8) -> Result<Self, ParseError>

Try converts i8 to UnsignedDecimal.

Source

pub const fn from_i16(int: i16) -> Result<Self, ParseError>

Try converts i16 to UnsignedDecimal.

Source

pub const fn from_i32(int: i32) -> Result<Self, ParseError>

Try converts i32 to UnsignedDecimal.

Source

pub const fn from_i64(int: i64) -> Result<Self, ParseError>

Try converts i64 to UnsignedDecimal.

Source

pub const fn from_i128(int: i128) -> Result<Self, ParseError>

Try converts i128 to UnsignedDecimal.

Source

pub const fn from_isize(int: isize) -> Result<Self, ParseError>

Try converts isize to UnsignedDecimal.

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn from_f32(n: f32) -> Result<Self, ParseError>

Try converts f32 to UnsignedDecimal.

Source

pub const fn from_f64(n: f64) -> Result<Self, ParseError>

Try converts f64 to UnsignedDecimal.

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn to_u8(self) -> Result<u8, ParseError>

Try converts UnsignedDecimal into u8.

Source

pub const fn to_u16(self) -> Result<u16, ParseError>

Try converts UnsignedDecimal into u16.

Source

pub const fn to_u32(self) -> Result<u32, ParseError>

Try converts UnsignedDecimal into u32.

Source

pub const fn to_u64(self) -> Result<u64, ParseError>

Try converts UnsignedDecimal into u64.

Source

pub const fn to_u128(self) -> Result<u128, ParseError>

Try converts UnsignedDecimal into u128.

Source

pub const fn to_usize(self) -> Result<usize, ParseError>

Try converts UnsignedDecimal into usize.

Source

pub const fn to_i8(self) -> Result<i8, ParseError>

Try converts UnsignedDecimal into i8.

Source

pub const fn to_i16(self) -> Result<i16, ParseError>

Try converts UnsignedDecimal into i16.

Source

pub const fn to_i32(self) -> Result<i32, ParseError>

Try converts UnsignedDecimal into i32.

Source

pub const fn to_i64(self) -> Result<i64, ParseError>

Try converts UnsignedDecimal into i64.

Source

pub const fn to_i128(self) -> Result<i128, ParseError>

Try converts UnsignedDecimal into i128.

Source

pub const fn to_isize(self) -> Result<isize, ParseError>

Try converts UnsignedDecimal into isize.

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn to_f32(self) -> f32

Converts UnsignedDecimal into f32.

Source

pub const fn to_f64(self) -> f64

Converts UnsignedDecimal into f64.

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const NAN: Self

Not A Number value. More about NaN.

Source

pub const INFINITY: Self

Infinity (∞). More about ±Infinity.

Source

pub const MIN: Self = Self::ZERO

The smallest value that can be represented by this decimal type (0).

Source

pub const MAX: Self

The largest value that can be represented by this decimal type (2N − 1)×1032’768.

Source

pub const MIN_POSITIVE: Self

The smallest positive, normalized value that this type can represent.

Source

pub const EPSILON: Self

Machine epsilon value.

This is the difference between 1.0 and the next larger representable number.

Source

pub const ZERO: Self

The value of 0 represented by this decimal type.

Source

pub const ONE: Self

The value of 1 represented by this decimal type.

Source

pub const TWO: Self

The value of 2 represented by this decimal type.

Source

pub const THREE: Self

The value of 3 represented by this decimal type.

Source

pub const FOUR: Self

The value of 4 represented by this decimal type.

Source

pub const FIVE: Self

The value of 5 represented by this decimal type.

Source

pub const SIX: Self

The value of 6 represented by this decimal type.

Source

pub const SEVEN: Self

The value of 7 represented by this decimal type.

Source

pub const EIGHT: Self

The value of 8 represented by this decimal type.

Source

pub const NINE: Self

The value of 9 represented by this decimal type.

Source

pub const TEN: Self

The value of 10 represented by this decimal type.

Source

pub const E: Self

Euler’s number (e).

Source

pub const PI: Self

Archimedes’ constant (π).

Source

pub const TAU: Self

The full circle constant (τ)

Equal to 2π.

Source

pub const FRAC_1_PI: Self

1/π.

Source

pub const FRAC_2_PI: Self

2/π.

Source

pub const FRAC_PI_2: Self

π/2.

Source

pub const FRAC_PI_3: Self

π/3.

Source

pub const FRAC_PI_4: Self

π/4.

Source

pub const FRAC_PI_6: Self

π/6.

Source

pub const FRAC_PI_8: Self

π/8.

Source

pub const FRAC_2_SQRT_PI: Self

2/sqrt(π).

Source

pub const LN_2: Self

ln(2).

Source

pub const LN_10: Self

ln(10).

Source

pub const LOG2_E: Self

log2(e).

Source

pub const LOG10_E: Self

log10(e).

Source

pub const SQRT_2: Self

sqrt(2).

Source

pub const FRAC_1_SQRT_2: Self

1/sqrt(2).

Source

pub const LOG10_2: Self

log10(2).

Source

pub const LOG2_10: Self

log2(10).

Source§

impl<const N: usize> UnsignedDecimal<N>

Source

pub const fn from_parts(digits: UInt<N>, exp: i32, ctx: Context) -> Self

Creates and initializes unsigned decimal from parts.

§Examples
use fastnum::{*, decimal::*};

assert_eq!(UD256::from_parts(u256!(12345), -4, Context::default()), udec256!(1.2345));
Source

pub const fn from_str(s: &str, ctx: Context) -> Result<Self, ParseError>

Creates and initializes an unsigned decimal from string.

§Examples
use fastnum::{*, decimal::*};

assert_eq!(UD256::from_str("1.2345", Context::default()), Ok(udec256!(1.2345)));
assert_eq!(UD256::from_str("-1.2345", Context::default()), Err(ParseError::Signed));
Source

pub const fn parse_str(s: &str, ctx: Context) -> Self

Parse an unsigned decimal from string.

§Panics

This function will panic if UnsignedDecimal<N> can’t be constructed from a given string.

§Examples

Basic usage:

use fastnum::{*, decimal::*};

assert_eq!(UD256::parse_str("1.2345", Context::default()), udec256!(1.2345));

Should panic:

use fastnum::{*, decimal::*};

let _ = UD256::parse_str("-1.2345", Context::default());
Source

pub const fn digits(&self) -> UInt<N>

Returns the internal big integer, representing the Coefficient of a given UnsignedDecimal, including significant trailing zeros.

§Examples
use fastnum::{udec256, u256};

let a = udec256!(123.45);
assert_eq!(a.digits(), u256!(12345));

let b = udec256!(1.0);
assert_eq!(b.digits(), u256!(10));
Source

pub const fn digits_count(&self) -> usize

Returns the count of digits in the non-scaled integer representation

Source

pub const fn fractional_digits_count(&self) -> i16

Returns the scale of the UnsignedDecimal, the total number of digits to the right of the decimal point (including insignificant leading zeros).

§Examples
use fastnum::udec256;

let a = udec256!(12345);  // No fractional part
let b = udec256!(123.45);  // Fractional part
let c = udec256!(0.0000012345);  // Completely fractional part
let d = udec256!(500000000);  // No fractional part
let e = udec256!(5e9);  // Negative-fractional part

assert_eq!(a.fractional_digits_count(), 0);
assert_eq!(b.fractional_digits_count(), 2);
assert_eq!(c.fractional_digits_count(), 10);
assert_eq!(d.fractional_digits_count(), 0);
assert_eq!(e.fractional_digits_count(), -9);
Source

pub const fn is_zero(&self) -> bool

Return if the referenced unsigned decimal is zero.

§Examples
use fastnum::{udec256};

let a = udec256!(0);
assert!(a.is_zero());

let b = udec256!(0.0);
assert!(b.is_zero());

let c = udec256!(0.00);
assert!(c.is_zero());

let d = udec256!(0.1);
assert!(!d.is_zero());
Source

pub const fn is_one(&self) -> bool

Return if the referenced unsigned decimal is strictly Self::ONE.

§Examples
use fastnum::{udec256};

let a = udec256!(1);
assert!(a.is_one());

let b = udec256!(10e-1);
assert!(!b.is_one());
Source

pub const fn is_op_div_by_zero(&self) -> bool

Returns true if the given decimal number is the result of division by zero and false otherwise.

§Examples
use fastnum::{*, decimal::*};

let ctx = Context::default().without_traps();
let res = udec256!(1.0).with_ctx(ctx) / udec256!(0).with_ctx(ctx);

assert!(res.is_op_div_by_zero());

More about OP_DIV_BY_ZERO signal.

Source

pub const fn is_op_invalid(&self) -> bool

Return true if the argument has Signals::OP_INVALID signal flag, and false otherwise.

Source

pub const fn is_op_subnormal(&self) -> bool

Return true if the argument has Signals::OP_SUBNORMAL signal flag, and false otherwise.

Source

pub const fn is_op_inexact(&self) -> bool

Return true if the argument has Signals::OP_INEXACT signal flag, and false otherwise.

Source

pub const fn is_op_rounded(&self) -> bool

Return true if the argument has Signals::OP_ROUNDED signal flag, and false otherwise.

Source

pub const fn is_op_clamped(&self) -> bool

Return true if the argument has Signals::OP_CLAMPED signal flag, and false otherwise.

Source

pub const fn is_op_overflow(&self) -> bool

Return true if the argument has Signals::OP_OVERFLOW signal flag, and false otherwise.

Source

pub const fn is_op_underflow(&self) -> bool

Return true if the argument has Signals::OP_UNDERFLOW signal flag, and false otherwise.

Source

pub const fn is_op_ok(&self) -> bool

Return true if the argument has no signal flags, and false otherwise.

Source

pub const fn op_signals(&self) -> Signals

Return the signaling block of given unsigned decimal.

Source

pub const fn classify(&self) -> FpCategory

Return the decimal category of the number. If only one property is going to be tested, it is generally faster to use the specific predicate instead.

§Examples
use core::num::FpCategory;
use fastnum::{udec256, UD256};

let num = udec256!(12.4);
let inf = UD256::INFINITY;

assert_eq!(num.classify(), FpCategory::Normal);
assert_eq!(inf.classify(), FpCategory::Infinite);
Source

pub const fn is_normal(self) -> bool

Return true if the number is neither zero, Infinity, subnormal, or NaN and false otherwise.

§Examples
use fastnum::*;

let num = udec256!(12.4);
let subnormal = udec256!(1E-30000) / udec256!(1E2768);
let inf = UD256::INFINITY;
let nan = UD256::NAN;
let zero = UD256::ZERO;

assert!(num.is_normal());

assert!(!zero.is_normal());
assert!(!nan.is_normal());
assert!(!nan.is_normal());
assert!(!subnormal.is_normal());
Source

pub const fn is_subnormal(self) -> bool

Return true if the number is subnormal and false otherwise.

§Examples
use fastnum::*;

let num = udec256!(12.4);
let subnormal = udec256!(1E-30000) / udec256!(1E2768);
let inf = UD256::INFINITY;
let nan = UD256::NAN;
let zero = UD256::ZERO;

assert!(subnormal.is_subnormal());

assert!(!num.is_subnormal());
assert!(!zero.is_subnormal());
assert!(!nan.is_subnormal());
assert!(!nan.is_subnormal());
Source

pub const fn is_finite(self) -> bool

Return true if this number is neither Infinity nor NaN and false otherwise.

§Examples
use fastnum::{UD256, udec256};

let d = udec256!(7.0);
let inf = UD256::INFINITY;
let nan = UD256::NAN;

assert!(d.is_finite());

assert!(!nan.is_finite());
assert!(!inf.is_finite());
Source

pub const fn is_infinite(self) -> bool

Return true if this value is Infinity and false otherwise.

§Examples
use fastnum::{UD256, udec256};

let d = udec256!(7.0);
let inf = UD256::INFINITY;
let nan = UD256::NAN;

assert!(inf.is_infinite());

assert!(!d.is_infinite());
assert!(!nan.is_infinite());
Source

pub const fn is_nan(self) -> bool

Return true if this value is NaN and false otherwise.

§Examples
use fastnum::{UD256, udec256};

let nan = UD256::NAN;
let d = udec256!(7.0);

assert!(nan.is_nan());
assert!(!d.is_nan());
Source

pub const fn with_ctx(self, ctx: Context) -> Self

Apply new Context to the given decimal number.

Returns a copy of the value with the provided context applied.

This method updates the operational context (including the rounding mode and other contextual parameters) used by subsequent operations that may round or clamp the value (e.g., add, sub, mul, div, round, rescale, quantize, etc.).

Important:

  • The change is local to the returned value and does not affect other values.
  • If you ignore the returned value, the context update is lost.
  • If the value currently carries extra precision, that extra precision is reconciled immediately with the new context: it is rounded using the context’s rounding mode (and may be clamped as dictated by the context).
  • If the current value already has signaling flags set (e.g., INEXACT and the new context enables traps for those signals, applying this method may trigger the corresponding traps immediately, which can result in a panic (depending on the build/configuration).
§Panics:
§debug mode

This method will panic if

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

let ctx = decimal::Context::default().without_traps();
let a = udec256!(1).with_ctx(ctx);
let b = udec256!(0).with_ctx(ctx);

// No panic! We can divide by zero!
let c = a / b;
assert!(c.is_infinite());
assert!(c.is_op_div_by_zero());

See also:

Source

pub const fn with_rounding_mode(self, rm: RoundingMode) -> Self

Apply new RoundingMode to the given decimal number.

Returns a copy of the value with an updated rounding mode in its context.

This method generally does not immediately change the mathematical value; it only sets the rounding rule that will be used by subsequent operations that may round (e.g., add, sub, mul, div, round, rescale, quantize, conversions, etc.).

Important:

  • The change is local to the returned value and does not affect other values.
  • If you ignore the returned value, the rounding mode update is lost.
  • If the value currently carries extra precision, that extra precision is rounded using the newly provided rounding mode at the moment this method is applied. This ensures internal consistency of the stored representation with the new rounding rule.
§Panics:
§debug mode

This method will panic if possible extra precision rounding operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

let a = udec256!(1).with_rounding_mode(decimal::RoundingMode::No);
let b = udec256!(3).with_rounding_mode(decimal::RoundingMode::No);
let c = udec256!(6).with_rounding_mode(decimal::RoundingMode::No);

assert_eq!(((a / b) * c).with_rounding_mode(decimal::RoundingMode::HalfUp), udec256!(2));

See also:

Source

pub const fn quantum(exp: i32, ctx: Context) -> Self

The quantum of a finite number is given by: 1 × 10exp. This is the value of a unit in the least significant position of the coefficient of a finite number.

§Examples
use fastnum::{*, decimal::*};

let ctx = Context::default();

assert_eq!(UD256::quantum(0, ctx), udec256!(1));
assert_eq!(UD256::quantum(-0, ctx), udec256!(1));
assert_eq!(UD256::quantum(-3, ctx), udec256!(0.001));
assert_eq!(UD256::quantum(3, ctx), udec256!(1000));
Source

pub const fn reduce(self) -> Self

Reduces a decimal number to its shortest (coefficient) form shifting all significant trailing zeros into the exponent.

§Examples
use fastnum::{udec256, u256, decimal::Context};

let a = udec256!(1234500);
assert_eq!(a.digits(), u256!(1234500));
assert_eq!(a.fractional_digits_count(), 0);

let b = a.reduce();
assert_eq!(b.digits(), u256!(12345));
assert_eq!(b.fractional_digits_count(), -2);
Source

pub const fn neg(self) -> Decimal<N>

Invert sign of the given unsigned decimal.

§Examples
use fastnum::*;

assert_eq!(udec256!(1.0).neg(), dec256!(-1.0));
Source

pub const fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by == operator.

Source

pub const fn ne(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by == operator.

Source

pub const fn max(self, other: Self) -> Self

Compares and returns the maximum of two unsigned decimal values.

Returns the second argument if the comparison determines them to be equal.

§Examples
use fastnum::{udec256};

assert_eq!(udec256!(1).max(udec256!(2)), udec256!(2));
assert_eq!(udec256!(2).max(udec256!(2)), udec256!(2));
Source

pub const fn min(self, other: Self) -> Self

Compares and returns the minimum of two undecimal values.

Returns the first argument if the comparison determines them to be equal.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(1).min(udec256!(2)), udec256!(1));
assert_eq!(udec256!(2).min(udec256!(2)), udec256!(2));
Source

pub const fn clamp(self, min: Self, max: Self) -> Self

Restrict an unsigned decimal value to a certain interval.

Returns max if self is greater than max, and min if self is less than min. Otherwise, this returns self.

§Panics

Panics if min > max.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(0).clamp(udec256!(3), udec256!(5)), udec256!(3));
assert_eq!(udec256!(3).clamp(udec256!(1), udec256!(5)), udec256!(3));
assert_eq!(udec256!(6).clamp(udec256!(1), udec256!(5)), udec256!(5));
Source

pub const fn lt(&self, other: &Self) -> bool

Tests unsigned decimal self less than other and is used by the < operator.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(1.0).lt(&udec256!(1.0)), false);
assert_eq!(udec256!(1.0).lt(&udec256!(2.0)), true);
assert_eq!(udec256!(2.0).lt(&udec256!(1.0)), false);
Source

pub const fn le(&self, other: &Self) -> bool

Tests unsigned decimal self less than or equal to other and is used by the <= operator.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(1.0).le(&udec256!(1.0)), true);
assert_eq!(udec256!(1.0).le(&udec256!(2.0)), true);
assert_eq!(udec256!(2.0).le(&udec256!(1.0)), false);
Source

pub const fn gt(&self, other: &Self) -> bool

Tests unsigned decimal self greater than other and is used by the > operator.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(1.0).gt(&udec256!(1.0)), false);
assert_eq!(udec256!(1.0).gt(&udec256!(2.0)), false);
assert_eq!(udec256!(2.0).gt(&udec256!(1.0)), true);
Source

pub const fn ge(&self, other: &Self) -> bool

Tests unsigned decimal self greater than or equal to other and is used by the >= operator.

§Examples
use fastnum::udec256;

assert_eq!(udec256!(1.0).ge(&udec256!(1.0)), true);
assert_eq!(udec256!(1.0).ge(&udec256!(2.0)), false);
assert_eq!(udec256!(2.0).ge(&udec256!(1.0)), true);
Source

pub const fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other.

By convention, self.cmp(&other) returns the ordering matching the expression self <operator> other if true.

§Examples
use fastnum::udec256;
use std::cmp::Ordering;

assert_eq!(udec256!(5).cmp(&udec256!(10)), Ordering::Less);
assert_eq!(udec256!(10).cmp(&udec256!(5)), Ordering::Greater);
assert_eq!(udec256!(5).cmp(&udec256!(5)), Ordering::Equal);
Source

pub const fn add(self, rhs: Self) -> Self

Calculates self + rhs.

Is internally used by the + operator.

§Panics:
§debug mode

This method will panic if addition operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

let a = UD256::ONE;
let b = UD256::TWO;

let c = a + b;
assert_eq!(c, udec256!(3));

Panics if overflowed:

use fastnum::*;

let a = UD256::MAX;
let b = UD256::MAX;

let c = a + b;

See more about add and subtract.

Source

pub const fn sub(self, rhs: Self) -> Self

Calculates selfrhs.

Is internally used by the - operator.

§Panics:
§debug mode

This method will panic if subtract operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

let a = UD256::FIVE;
let b = UD256::TWO;

let c = a - b;
assert_eq!(c, udec256!(3));

Panics if overflowed:

use fastnum::*;

let a = UD256::ZERO;
let b = UD256::ONE;

let c = a - b;

See more about add and subtract.

Source

pub const fn mul(self, rhs: Self) -> Self

Calculates self × rhs.

Is internally used by the * operator.

§Panics:
§debug mode

This method will panic if multiplication operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

let a = UD256::FIVE;
let b = UD256::TWO;

let c = a * b;
assert_eq!(c, udec256!(10));

Panics if overflowed:

use fastnum::*;

let a = UD256::MAX;
let b = UD256::MAX;

let c = a * b;

See more about multiplication.

Source

pub const fn div(self, rhs: Self) -> Self

Calculates self ÷ rhs.

Is internally used by the / operator.

§Panics:
§debug mode

This method will panic if divide operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

let a = UD256::FIVE;
let b = UD256::TWO;

let c = a / b;
assert_eq!(c, udec256!(2.5));

Panics if divided by zero:

use fastnum::*;

let a = UD256::ONE;
let b = UD256::ZERO;

let c = a / b;

See more about division.

Source

pub const fn rem(self, rhs: Self) -> Self

Calculates self % rhs.

Is internally used by the % operator.

§Panics:
§debug mode

This method will panic if reminder operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

let a = UD256::FIVE;
let b = UD256::TWO;

let c = a % b;
assert_eq!(c, udec256!(1));
Source

pub const fn recip(self) -> Self

Takes the reciprocal (inverse) of a number, 1/x.

§Panics:
§debug mode

This method will panic if reciprocal operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Precision

Since the result of reciprocal is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Examples
use fastnum::*;

assert_eq!(udec256!(2).recip(), udec256!(0.5));
Source

pub const fn pow(self, n: Decimal<N>) -> Self

Raise an unsigned decimal number to decimal power.

Using this function is generally slower than using powi for integer exponents or sqrt method for 1/2 exponent.

§Panics:
§debug mode

This method will panic if power operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

assert_eq!(udec256!(4).pow(dec256!(0.5)), udec256!(2));
assert_eq!(udec256!(8).pow(dec256!(1) / dec256!(3)), udec256!(2));

See more about the power operation.

Source

pub const fn powi(self, n: i32) -> Self

Raise an unsigned decimal number to an integer power.

Using this function is generally faster than using pow

§Panics:
§debug mode

This method will panic if power operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

assert_eq!(udec256!(2).powi(3), udec256!(8));
assert_eq!(udec256!(9).powi(2), udec256!(81));
assert_eq!(udec256!(1).powi(-2), udec256!(1));
assert_eq!(udec256!(10).powi(20), udec256!(1e20));
assert_eq!(udec256!(4).powi(-2), udec256!(0.0625));

See more about the power operation.

Source

pub const fn sqrt(self) -> Self

Take the square root of the unsigned decimal number.

Square-root can also be calculated by using the power operation (with a second operand of 0.5). The result in that case will not be exact and may not be correctly rounded.

§Panics:
§debug mode

This method will panic if sqrt operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

assert_eq!(udec128!(4).sqrt(), udec128!(2));
assert_eq!(udec128!(1).sqrt(), udec128!(1));
assert_eq!(udec128!(16).sqrt(), udec128!(4));

See more about the square-root operation.

Source

pub const fn exp(self) -> Self

Returns eself, (the exponential function).

§Panics:
§debug mode

This method will panic if exponent operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

assert_eq!(udec128!(1).exp(), UD128::E);

See more about the exponential function.

Source

pub const fn ln(self) -> Decimal<N>

Returns the natural logarithm of the decimal number.

§Precision

Since the result of natural logarithm is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Panics:
§debug mode

This method will panic if logarithm operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(2).ln(), D256::LN_2);
assert_eq!(UD256::E.ln(), D256::ONE);

See also:

Source

pub const fn ln_1p(self) -> Decimal<N>

Returns natural logarithm ln(1 + self) more accurately than if the operations were performed separately.

§Precision

Since the result of natural logarithm is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Panics:
§debug mode

This method will panic if logarithm operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!((UD256::E - udec256!(1)).ln_1p(), dec256!(1));

See also:

Source

pub const fn log(self, base: Self) -> Decimal<N>

Returns the logarithm of the decimal number with respect to the given arbitrary base.

§Precision

Since the result of logarithm is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Panics:
§debug mode

This method will panic if logarithm operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(64).log(udec256!(2)), dec256!(6));
assert_eq!(udec256!(27).log(udec256!(3)), dec256!(3));
assert_eq!(udec256!(15625).log(udec256!(5)), dec256!(6));

See also:

Source

pub const fn log2(self) -> Decimal<N>

Returns the binary logarithm of the given decimal number.

§Precision

Since the result of logarithm is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Panics:
§debug mode

This method will panic if logarithm operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(64).log2(), dec256!(6));
assert_eq!(udec256!(32).log2(), dec256!(5));
assert_eq!(udec256!(1024).log2(), dec256!(10));
assert_eq!(udec256!(0.5).log2(), dec256!(-1));
assert_eq!(udec256!(0.25).log2(), dec256!(-2));
assert_eq!(udec256!(10).log2(), D256::LOG2_10);

See also:

Source

pub const fn log10(self) -> Decimal<N>

Returns the decimal logarithm of the given decimal number.

§Precision

Since the result of logarithm is irrational number, it can usually only be computed to some finite precision from a series of increasingly accurate approximations.

The result of this operation is mostly inexact and raises OP_INEXACT signal.

§Panics:
§debug mode

This method will panic if logarithm operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(100).log10(), dec256!(2));
assert_eq!(udec256!(1000).log10(), dec256!(3));
assert_eq!(udec256!(0.1).log10(), dec256!(-1));
assert_eq!(udec256!(0.01).log10(), dec256!(-2));
assert_eq!(udec256!(2).log10(), D256::LOG10_2);

See also:

Source

pub const fn mul_add(self, a: Self, b: Self) -> Self

Fused multiply-add. Computes (self * a) + b with only one rounding error, yielding a more accurate result than an unfused multiply-add.

§Panics:
§debug mode

This method will panic if multiply-add operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Basic usage:

use fastnum::*;

assert_eq!(udec128!(10.0).mul_add(udec128!(4.0), udec128!(60)), udec128!(100));

See more about the fused multiply-add function.

Source

pub const fn round(self, digits: i16) -> Self

Returns the given decimal number rounded to digits precision after the decimal point, using RoundingMode from it Context.

§Panics:
§debug mode

This method will panic if round operation (up-scale or down-scale) performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples
use fastnum::{*, decimal::{*, RoundingMode::*}};

let n = udec256!(129.41675);

// Default rounding mode is `HalfUp`
assert_eq!(n.round(2),  udec256!(129.42));

assert_eq!(n.with_rounding_mode(Up).round(2), udec256!(129.42));
assert_eq!(n.with_rounding_mode(Down).round(-1), udec256!(120));
assert_eq!(n.with_rounding_mode(HalfEven).round(4), udec256!(129.4168));

See also:

Source

pub const fn floor(self) -> Self

Returns the largest integer less than or equal to a number.

§Examples
use fastnum::*;

assert_eq!(udec256!(3.99).floor(), udec256!(3));
assert_eq!(udec256!(3.0).floor(), udec256!(3.0));
assert_eq!(udec256!(3.01).floor(), udec256!(3));
assert_eq!(udec256!(3.5).floor(), udec256!(3));
assert_eq!(udec256!(4.0).floor(), udec256!(4));
Source

pub const fn ceil(self) -> Self

Finds the nearest integer greater than or equal to x.

§Examples
use fastnum::*;

assert_eq!(udec256!(3.01).ceil(), udec256!(4));
assert_eq!(udec256!(3.99).ceil(), udec256!(4));
assert_eq!(udec256!(4.0).ceil(), udec256!(4));
assert_eq!(udec256!(1.0001).ceil(), udec256!(2));
assert_eq!(udec256!(1.00001).ceil(), udec256!(2));
assert_eq!(udec256!(1.000001).ceil(), udec256!(2));
assert_eq!(udec256!(1.00000000000001).ceil(), udec256!(2));
Source

pub const fn rescale(self, new_scale: i16) -> Self

Returns the given decimal number re-scaled to digits precision after the decimal point.

§Panics:
§debug mode

This method will panic if rescale operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples
use fastnum::{*, decimal::*};

assert_eq!(udec256!(2.17).rescale(3), udec256!(2.170));
assert_eq!(udec256!(2.17).rescale(2), udec256!(2.17));
assert_eq!(udec256!(2.17).rescale(1), udec256!(2.2));
assert_eq!(udec256!(2.17).rescale(0), udec256!(2));
assert_eq!(udec256!(2.17).rescale(-1), udec256!(0));

let ctx = Context::default().without_traps();

assert!(UD256::INFINITY.with_ctx(ctx).rescale(2).is_nan());
assert!(UD256::NAN.with_ctx(ctx).rescale(1).is_nan());

See also:

Source

pub const fn quantize(self, other: Self) -> Self

Returns a value equal to self (rounded), having the exponent of other.

§Panics:
§debug mode

This method will panic if quantize operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples
use fastnum::{*, decimal::*};

let ctx = Context::default().without_traps();

assert_eq!(udec256!(2.17).quantize(udec256!(0.001)), udec256!(2.170));
assert_eq!(udec256!(2.17).quantize(udec256!(0.01)), udec256!(2.17));
assert_eq!(udec256!(2.17).quantize(udec256!(0.1)), udec256!(2.2));
assert_eq!(udec256!(2.17).quantize(udec256!(1e+0)), udec256!(2));
assert_eq!(udec256!(2.17).quantize(udec256!(1e+1)), udec256!(0));

assert_eq!(UD256::INFINITY.quantize(UD256::INFINITY), UD256::INFINITY);

assert!(udec256!(2).with_ctx(ctx).quantize(UD256::INFINITY).is_nan());

assert_eq!(udec256!(0.1).quantize(udec256!(1)), udec256!(0));
assert_eq!(udec256!(0).quantize(udec256!(1e+5)), udec256!(0E+5));

assert!(udec128!(0.34028).with_ctx(ctx).quantize(udec128!(1e-32765)).is_nan());

assert_eq!(udec256!(217).quantize(udec256!(1e-1)), udec256!(217.0));
assert_eq!(udec256!(217).quantize(udec256!(1e+0)), udec256!(217));
assert_eq!(udec256!(217).quantize(udec256!(1e+1)), udec256!(2.2E+2));
assert_eq!(udec256!(217).quantize(udec256!(1e+2)), udec256!(2E+2));

See also:

Source

pub const fn trunc(self) -> Self

Truncates the decimal number to integral with no fractional portion.

This is a true truncation whereby no rounding is performed. This operation is equivalent to Self::rescale or Self::trunc_with_scale with scale set to 0.

§Performance

This operation is typically much faster than Self::rescale

§Panics:
§debug mode

This method will panic if truncate operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(3.141).trunc(), udec256!(3));
assert_eq!(udec256!(2.9).trunc(), udec256!(2));

let ctx = decimal::Context::default().without_traps();

assert!(UD256::INFINITY.with_ctx(ctx).trunc().is_nan());
assert!(UD256::NAN.with_ctx(ctx).trunc().is_nan());

See also:

Source

pub const fn trunc_with_scale(self, scale: i16) -> Self

Truncates the decimal number to the given number of digits after the decimal point.

This is a true truncation whereby no rounding is performed. This operation is equivalent to Self::rescale.

§Performance

This operation is typically much faster than Self::rescale

§Panics:
§debug mode

This method will panic if truncate operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD256 is used here.

use fastnum::*;

assert_eq!(udec256!(3.141592).trunc_with_scale(2), udec256!(3.14));
assert_eq!(udec256!(3.141592).trunc_with_scale(3), udec256!(3.141));
assert_eq!(udec256!(3.141592).trunc_with_scale(4), udec256!(3.1415));
assert_eq!(udec256!(3.141592).trunc_with_scale(5), udec256!(3.14159));
assert_eq!(udec256!(3.141592).trunc_with_scale(6), udec256!(3.141592));

let ctx = decimal::Context::default().without_traps();

assert!(UD256::INFINITY.with_ctx(ctx).trunc_with_scale(1).is_nan());
assert!(UD256::NAN.with_ctx(ctx).trunc_with_scale(1).is_nan());

See also:

Source

pub const fn is_ok(&self) -> bool

Returns:

Source

pub const fn ok(self) -> Option<Self>

Returns:

Source

pub fn to_scientific_notation(&self) -> String

Create a string of this unsigned decimal in scientific notation.

§Examples
use fastnum::udec256;

let n = udec256!(12345678);
assert_eq!(&n.to_scientific_notation(), "1.2345678e7");
Source

pub fn to_engineering_notation(&self) -> String

Create a string of this unsigned decimal in engineering notation.

Engineering notation is scientific notation with the exponent coerced to a multiple of three.

§Examples
use fastnum::udec256;

let n = udec256!(12345678);
assert_eq!(&n.to_engineering_notation(), "12.345678e6");
Source

pub const fn to_signed(self) -> Decimal<N>

Converts the given unsigned decimal to a signed decimal number.

§Examples
use fastnum::*;

let d = udec256!(1.2345);

assert_eq!(d.to_signed(), dec256!(1.2345));
Source

pub const fn try_from_signed(d: Decimal<N>) -> Result<Self, DecimalError>

Try converts from Decimal to UnsignedDecimal.

§Examples
use fastnum::*;

assert_eq!(UD256::try_from_signed(dec256!(1.2345)), Ok(udec256!(1.2345)));
assert!(UD256::try_from_signed(dec256!(-1.2345)).is_err());
Source

pub const fn transmute<const M: usize>(self) -> UnsignedDecimal<M>

👎Deprecated since 0.5.0

Deprecated, use resize instead.

Source

pub const fn resize<const M: usize>(self) -> UnsignedDecimal<M>

Safety resizes the underlying decimal to use M limbs while preserving the numeric value when possible.

This operation can either widen or narrow the internal representation:

  • Widening (M >= N) is lossless: the value is preserved.
  • Narrowing (M < N) may reduce available capacity. In this case the value is rounded according to the current Context and corresponding status flags are set.

Behavior details:

  • Rounding: extra precision is rounded using the active RoundingMode from the current context.
  • Signals: status flags such as Inexact, Rounded, Clamped, Overflow, or Underflow may be raised depending on the operation outcome and context limits.

Note: lossless, no-rounding conversions.

If you need to change width without any rounding:

  • Use crate::Cast for guaranteed-lossless widening (value-preserving by definition).

  • Use crate::TryCast for potential narrowing without rounding; it returns an error if the value does not fit into the target width, thus guaranteeing no silent rounding or truncation.

§Performance

This operation is typically much slower than crate::Cast and crate::TryCast transformations.

§Panics:
§debug mode

This method will panic if resize operation performs with some Exceptional condition and corresponding Signals in the Context is trapped by trap-enabler.

§release mode

In release mode panic will not occur and result can be one of Special values(NaN or ±Infinity).

§Examples

Please note that this example is shared between decimal types. Which explains why UD64 is used here.

§Lossless widening:
use fastnum::*;

let x = udec64!(123.45);

// Increase internal width from 2 to 4 limbs — value is preserved.
let y: UD128 = x.resize();
assert_eq!(y, udec128!(123.45));
assert!(y.is_op_ok());
§Narrowing with possible rounding:
use fastnum::*;

let x = udec128!(1.8446744073709551616);

// Reduce width; value may be rounded according to context.
let y: UD64 = x.resize();
// Rounding/precision-loss indicators may be set, depending on capacity and context:
assert_eq!(y, udec64!(1.844674407370955162));
assert!(y.is_op_inexact() && y.is_op_rounded());

See also:

Trait Implementations§

Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for f32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for f64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for i128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for i16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for i32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for i64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for i8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for isize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for u128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for u16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for u32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for u64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for u8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<UnsignedDecimal<N>> for usize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<f32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f32) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<f64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f64) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<i128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i128) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<i16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i16) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<i32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i32) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<i64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i64) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<i8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i8) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<isize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: isize) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<u128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u128) -> UnsignedDecimal<N>

Performs the + operation. Read more
Source§

impl<const N: usize> Add<u16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u16) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<u32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u32) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<u64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u64) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<u8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u8) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<usize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: usize) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> AddAssign<f32> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: f32)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<f64> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: f64)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<i128> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: i128)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<i16> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: i16)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<i32> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: i32)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<i64> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: i64)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<i8> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: i8)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<isize> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: isize)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<u128> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: u128)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<u16> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: u16)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<u32> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: u32)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<u64> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: u64)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<u8> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: u8)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign<usize> for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: usize)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign for UnsignedDecimal<N>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<const N: usize> AsExpression<Nullable<Numeric>> for &UnsignedDecimal<N>

Source§

type Expression = Bound<Nullable<Numeric>, &UnsignedDecimal<N>>

The expression being returned
Source§

fn as_expression(self) -> Self::Expression

Perform the conversion
Source§

impl<const N: usize> AsExpression<Nullable<Numeric>> for UnsignedDecimal<N>

Source§

type Expression = Bound<Nullable<Numeric>, UnsignedDecimal<N>>

The expression being returned
Source§

fn as_expression(self) -> Self::Expression

Perform the conversion
Source§

impl<const N: usize> AsExpression<Numeric> for &UnsignedDecimal<N>

Source§

type Expression = Bound<Numeric, &UnsignedDecimal<N>>

The expression being returned
Source§

fn as_expression(self) -> Self::Expression

Perform the conversion
Source§

impl<const N: usize> AsExpression<Numeric> for UnsignedDecimal<N>

Source§

type Expression = Bound<Numeric, UnsignedDecimal<N>>

The expression being returned
Source§

fn as_expression(self) -> Self::Expression

Perform the conversion
Source§

impl<const N: usize, const M: usize> Cast<Decimal<N>> for UnsignedDecimal<N>
where Dimension<N, M>: Widen,

Source§

fn cast(self) -> Decimal<N>

Performs an infallible, value-preserving conversion. Read more
Source§

impl<const N: usize> Cast<Decimal<N>> for UnsignedDecimal<N>

Source§

fn cast(self) -> Decimal<N>

Performs an infallible, value-preserving conversion. Read more
Source§

impl<const N: usize, const M: usize> Cast<UnsignedDecimal<N>> for UnsignedDecimal<N>
where Dimension<N, M>: Widen,

Source§

fn cast(self) -> UnsignedDecimal<N>

Performs an infallible, value-preserving conversion. Read more
Source§

impl<const N: usize> Clone for UnsignedDecimal<N>

Source§

fn clone(&self) -> UnsignedDecimal<N>

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> ComposeSchema for UnsignedDecimal<N>

Source§

impl<const N: usize> ConstOne for UnsignedDecimal<N>

Source§

const ONE: Self = Self::ONE

The multiplicative identity element of Self, 1.
Source§

impl<const N: usize> ConstZero for UnsignedDecimal<N>

Source§

const ZERO: Self = Self::ZERO

The additive identity element of Self, 0.
Source§

impl<const N: usize> Debug for UnsignedDecimal<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Decode<'_, Postgres> for UnsignedDecimal<N>

Source§

fn decode(value: PgValueRef<'_>) -> Result<Self, BoxDynError>

Decode a new value of this type using a raw value from the database.
Source§

impl<const N: usize> Default for UnsignedDecimal<N>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, const N: usize> Deserialize<'de> for UnsignedDecimal<N>

Source§

fn deserialize<D>(d: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<const N: usize> Display for UnsignedDecimal<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for f32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for f64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for i128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for i16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for i32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for i64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for i8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for isize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for u128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for u16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for u32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for u64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for u8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<UnsignedDecimal<N>> for usize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<f32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<f64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<i128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i128) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<i16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i16) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<i32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i32) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<i64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i64) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<i8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i8) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<isize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: isize) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<u128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u128) -> UnsignedDecimal<N>

Performs the / operation. Read more
Source§

impl<const N: usize> Div<u16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u16) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<u32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u32) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<u64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u64) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<u8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u8) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<usize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: usize) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> DivAssign<f32> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: f32)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<f64> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: f64)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<i128> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: i128)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<i16> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: i16)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<i32> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: i32)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<i64> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: i64)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<i8> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: i8)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<isize> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: isize)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<u128> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: u128)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<u16> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: u16)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<u32> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: u32)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<u64> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: u64)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<u8> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: u8)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign<usize> for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: usize)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign for UnsignedDecimal<N>

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<const N: usize> Encode<'_, Postgres> for UnsignedDecimal<N>

Source§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, BoxDynError>

Writes the value of self into buf without moving self. Read more
Source§

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where Self: Sized,

Writes the value of self into buf in the expected format for the database.
Source§

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

Source§

fn size_hint(&self) -> usize

Source§

impl<const N: usize> FloatConst for UnsignedDecimal<N>

Source§

fn E() -> Self

Return Euler’s number.
Source§

fn FRAC_1_PI() -> Self

Return 1.0 / π.
Source§

fn FRAC_1_SQRT_2() -> Self

Return 1.0 / sqrt(2.0).
Source§

fn FRAC_2_PI() -> Self

Return 2.0 / π.
Source§

fn FRAC_2_SQRT_PI() -> Self

Return 2.0 / sqrt(π).
Source§

fn FRAC_PI_2() -> Self

Return π / 2.0.
Source§

fn FRAC_PI_3() -> Self

Return π / 3.0.
Source§

fn FRAC_PI_4() -> Self

Return π / 4.0.
Source§

fn FRAC_PI_6() -> Self

Return π / 6.0.
Source§

fn FRAC_PI_8() -> Self

Return π / 8.0.
Source§

fn LN_10() -> Self

Return ln(10.0).
Source§

fn LN_2() -> Self

Return ln(2.0).
Source§

fn LOG10_E() -> Self

Return log10(e).
Source§

fn LOG2_E() -> Self

Return log2(e).
Source§

fn PI() -> Self

Return Archimedes’ constant π.
Source§

fn SQRT_2() -> Self

Return sqrt(2.0).
Source§

fn TAU() -> Self

Return the full circle constant τ.
Source§

fn LOG10_2() -> Self

Return log10(2.0).
Source§

fn LOG2_10() -> Self

Return log2(10.0).
Source§

impl<const N: usize> From<UnsignedDecimal<N>> for Decimal<N>

Source§

fn from(ud: UnsignedDecimal<N>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<UnsignedDecimal<N>> for f32

Source§

fn from(d: UnsignedDecimal<N>) -> f32

Converts to this type from the input type.
Source§

impl<const N: usize> From<UnsignedDecimal<N>> for f64

Source§

fn from(d: UnsignedDecimal<N>) -> f64

Converts to this type from the input type.
Source§

impl<const N: usize> From<u16> for UnsignedDecimal<N>

Source§

fn from(n: u16) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<u32> for UnsignedDecimal<N>

Source§

fn from(n: u32) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<u64> for UnsignedDecimal<N>

Source§

fn from(n: u64) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<u8> for UnsignedDecimal<N>

Source§

fn from(n: u8) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<usize> for UnsignedDecimal<N>

Source§

fn from(n: usize) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> FromPrimitive for UnsignedDecimal<N>

Source§

fn from_u8(n: u8) -> Option<Self>

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u16(n: u16) -> Option<Self>

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u32(n: u32) -> Option<Self>

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u64(n: u64) -> Option<Self>

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_usize(n: usize) -> Option<Self>

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u128(n: u128) -> Option<Self>

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_i8(n: i8) -> Option<Self>

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i16(n: i16) -> Option<Self>

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i32(n: i32) -> Option<Self>

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i64(n: i64) -> Option<Self>

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_isize(n: isize) -> Option<Self>

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i128(n: i128) -> Option<Self>

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_f32(n: f32) -> Option<Self>

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f64(n: f64) -> Option<Self>

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

impl<'a, const N: usize> FromSql<'a> for UnsignedDecimal<N>

Source§

fn from_sql( _: &Type, raw: &'a [u8], ) -> Result<Self, Box<dyn Error + Sync + Send>>

Creates a new value of this type from a buffer of data of the specified Postgres Type in its binary format. Read more
Source§

fn accepts(ty: &Type) -> bool

Determines if a value of this type can be created from the specified Postgres Type.
Source§

fn from_sql_null(ty: &Type) -> Result<Self, Box<dyn Error + Send + Sync>>

Creates a new value of this type from a NULL SQL value. Read more
Source§

fn from_sql_nullable( ty: &Type, raw: Option<&'a [u8]>, ) -> Result<Self, Box<dyn Error + Send + Sync>>

A convenience function that delegates to from_sql and from_sql_null depending on the value of raw.
Source§

impl<const N: usize> FromSql<Numeric, Mysql> for UnsignedDecimal<N>

Source§

fn from_sql(value: MysqlValue<'_>) -> Result<Self>

See the trait documentation.
Source§

fn from_nullable_sql( bytes: Option<<DB as Backend>::RawValue<'_>>, ) -> Result<Self, Box<dyn Error + Send + Sync>>

A specialized variant of from_sql for handling null values. Read more
Source§

impl<const N: usize> FromSql<Numeric, Pg> for UnsignedDecimal<N>

Source§

fn from_sql(numeric: PgValue<'_>) -> Result<Self>

See the trait documentation.
Source§

fn from_nullable_sql( bytes: Option<<DB as Backend>::RawValue<'_>>, ) -> Result<Self, Box<dyn Error + Send + Sync>>

A specialized variant of from_sql for handling null values. Read more
Source§

impl<const N: usize> FromStr for UnsignedDecimal<N>

Source§

type Err = ParseError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, ParseError>

Parses a string s to return a value of this type. Read more
Source§

impl<const N: usize> Hash for UnsignedDecimal<N>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const N: usize> LowerExp for UnsignedDecimal<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for f32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for f64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for i128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for i16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for i32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for i64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for i8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for isize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for u128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for u16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for u32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for u64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for u8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<UnsignedDecimal<N>> for usize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<f32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<f64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<i128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i128) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<i16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i16) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<i32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i32) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<i64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i64) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<i8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i8) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<isize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: isize) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<u128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u128) -> UnsignedDecimal<N>

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<u16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u16) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<u32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u32) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<u64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u64) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<u8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u8) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<usize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: usize) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> MulAssign<f32> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: f32)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<f64> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: f64)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<i128> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: i128)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<i16> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: i16)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<i32> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: i32)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<i64> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: i64)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<i8> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: i8)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<isize> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: isize)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<u128> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: u128)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<u16> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: u16)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<u32> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: u32)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<u64> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: u64)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<u8> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: u8)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign<usize> for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: usize)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign for UnsignedDecimal<N>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<const N: usize> Neg for UnsignedDecimal<N>

Source§

type Output = Decimal<N>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Decimal<N>

Performs the unary - operation. Read more
Source§

impl<const N: usize> Num for UnsignedDecimal<N>

Source§

type FromStrRadixErr = ParseError

Source§

fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>

Convert from a string and radix (typically 2..=36). Read more
Source§

impl<const N: usize> One for UnsignedDecimal<N>

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
Source§

impl<const N: usize> Ord for UnsignedDecimal<N>

Source§

fn cmp(&self, rhs: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<const N: usize> PartialEq for UnsignedDecimal<N>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
Source§

fn ne(&self, other: &Self) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> PartialOrd for UnsignedDecimal<N>

Source§

fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const N: usize> PgHasArrayType for UnsignedDecimal<N>

Source§

impl<DB, ST, const N: usize> Queryable<ST, DB> for UnsignedDecimal<N>
where DB: Backend, ST: SingleValue, Self: FromSql<ST, DB>,

Source§

type Row = UnsignedDecimal<N>

The Rust type you’d like to map from. Read more
Source§

fn build(row: Self::Row) -> Result<Self>

Construct an instance of this type
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for f32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for f64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for i128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for i16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for i32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for i64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for i8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for isize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for u128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for u16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for u32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for u64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for u8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<UnsignedDecimal<N>> for usize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<f32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: f32) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<f64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: f64) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<i128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i128) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<i16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i16) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<i32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i32) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<i64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i64) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<i8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i8) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<isize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: isize) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<u128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u128) -> UnsignedDecimal<N>

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<u16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u16) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<u32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u32) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<u64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u64) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<u8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u8) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<usize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: usize) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> RemAssign<f32> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: f32)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<f64> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: f64)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<i128> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: i128)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<i16> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: i16)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<i32> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: i32)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<i64> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: i64)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<i8> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: i8)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<isize> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: isize)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<u128> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: u128)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<u16> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: u16)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<u32> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: u32)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<u64> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: u64)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<u8> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: u8)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign<usize> for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: usize)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign for UnsignedDecimal<N>

Source§

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
Source§

impl<const N: usize> Serialize for UnsignedDecimal<N>
where Self: Display,

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for f32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for f64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for i128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for i16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for i32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for i64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for i8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for isize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for u128

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for u16

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for u32

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for u64

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for u8

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<UnsignedDecimal<N>> for usize

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnsignedDecimal<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<f32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f32) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<f64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f64) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<i128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i128) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<i16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i16) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<i32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i32) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<i64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i64) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<i8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i8) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<isize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: isize) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<u128> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u128) -> UnsignedDecimal<N>

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<u16> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u16) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<u32> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u32) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<u64> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u64) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<u8> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u8) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<usize> for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: usize) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub for UnsignedDecimal<N>

Source§

type Output = UnsignedDecimal<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> SubAssign<f32> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: f32)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<f64> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: f64)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<i128> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: i128)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<i16> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: i16)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<i32> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: i32)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<i64> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: i64)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<i8> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: i8)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<isize> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: isize)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<u128> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: u128)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<u16> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: u16)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<u32> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: u32)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<u64> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: u64)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<u8> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: u8)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign<usize> for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: usize)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign for UnsignedDecimal<N>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<const N: usize> Sum for UnsignedDecimal<N>

Source§

fn sum<I: Iterator<Item = UnsignedDecimal<N>>>(iter: I) -> UnsignedDecimal<N>

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<const N: usize> ToPrimitive for UnsignedDecimal<N>

Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more
Source§

impl<const N: usize> ToSchema for UnsignedDecimal<N>

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference utoipa::openapi::schema::Schemas for this type. Read more
Source§

impl<DB, const N: usize> ToSql<Nullable<Numeric>, DB> for UnsignedDecimal<N>
where DB: Backend, Self: ToSql<Numeric, DB>,

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result

See the trait documentation.
Source§

impl<const N: usize> ToSql<Numeric, Mysql> for UnsignedDecimal<N>
where for<'a, 'b> Output<'a, 'b, Mysql>: Write, UnsignedDecimal<N>: Debug + Display,

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

See the trait documentation.
Source§

impl<const N: usize> ToSql<Numeric, Pg> for UnsignedDecimal<N>

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

See the trait documentation.
Source§

impl<const N: usize> ToSql for UnsignedDecimal<N>

Source§

fn to_sql( &self, _: &Type, out: &mut BytesMut, ) -> Result<IsNull, Box<dyn Error + Sync + Send>>
where Self: Sized,

Converts the value of self into the binary format of the specified Postgres Type, appending it to out. Read more
Source§

fn accepts(ty: &Type) -> bool

Determines if a value of this type can be converted to the specified Postgres Type.
Source§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut, ) -> Result<IsNull, Box<dyn Error + Sync + Send>>

An adaptor method used internally by Rust-Postgres. Read more
Source§

fn encode_format(&self, _ty: &Type) -> Format

Specify the encode format
Source§

impl<const N: usize, const M: usize> TryCast<Decimal<N>> for UnsignedDecimal<N>
where Dimension<N, M>: Narrow,

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_cast(self) -> Result<Decimal<N>, Self::Error>

Attempts to convert self into T, returning an error on failure. Read more
Source§

impl<const N: usize, const M: usize> TryCast<UnsignedDecimal<N>> for Decimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_cast(self) -> Result<UnsignedDecimal<N>, Self::Error>

Attempts to convert self into T, returning an error on failure. Read more
Source§

impl<const N: usize, const M: usize> TryCast<UnsignedDecimal<N>> for UnsignedDecimal<N>
where Dimension<N, M>: Narrow,

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_cast(self) -> Result<UnsignedDecimal<N>, Self::Error>

Attempts to convert self into T, returning an error on failure. Read more
Source§

impl<const N: usize> TryFrom<Decimal<N>> for UnsignedDecimal<N>

Source§

type Error = DecimalError

The type returned in the event of a conversion error.
Source§

fn try_from(d: Decimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<PgNumeric> for UnsignedDecimal<N>

Source§

type Error = Box<dyn Error + Send + Sync>

The type returned in the event of a conversion error.
Source§

fn try_from(numeric: PgNumeric) -> Result<Self>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for PgNumeric

Source§

type Error = Box<dyn Error + Send + Sync>

The type returned in the event of a conversion error.
Source§

fn try_from(dec: UnsignedDecimal<N>) -> Result<Self>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i128

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i16

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i32

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i64

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for i8

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for isize

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u128

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u16

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u32

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u64

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for u8

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<UnsignedDecimal<N>> for usize

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(ud: UnsignedDecimal<N>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<f32> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(n: f32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<f64> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(n: f64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i128> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i16> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i32> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i64> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i8> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<isize> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(int: isize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<u128> for UnsignedDecimal<N>

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(n: u128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> Type<Postgres> for UnsignedDecimal<N>

Source§

fn type_info() -> PgTypeInfo

Returns the canonical SQL type for this Rust type. Read more
Source§

fn compatible(ty: &<DB as Database>::TypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more
Source§

impl<const N: usize> UpperExp for UnsignedDecimal<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Zero for UnsignedDecimal<N>

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<const N: usize> Copy for UnsignedDecimal<N>

Source§

impl<const N: usize> DefaultIsZeroes for UnsignedDecimal<N>

Source§

impl<const N: usize> Eq for UnsignedDecimal<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for UnsignedDecimal<N>

§

impl<const N: usize> RefUnwindSafe for UnsignedDecimal<N>

§

impl<const N: usize> Send for UnsignedDecimal<N>

§

impl<const N: usize> Sync for UnsignedDecimal<N>

§

impl<const N: usize> Unpin for UnsignedDecimal<N>

§

impl<const N: usize> UnwindSafe for UnsignedDecimal<N>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BorrowToSql for T
where T: ToSql,

Source§

fn borrow_to_sql(&self) -> &dyn ToSql

Returns a reference to self as a ToSql trait object.
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<I> FromRadix10 for I
where I: Zero + One + AddAssign + MulAssign,

Source§

fn from_radix_10(text: &[u8]) -> (I, usize)

Parses an integer from a slice. Read more
Source§

impl<I> FromRadix10Signed for I

Source§

fn from_radix_10_signed(text: &[u8]) -> (I, usize)

Parses an integer from a slice. Read more
Source§

impl<I> FromRadix16 for I
where I: Zero + One + AddAssign + MulAssign,

Source§

fn from_radix_16(text: &[u8]) -> (I, usize)

Parses an integer from a slice. Read more
Source§

impl<T, ST, DB> FromSqlRow<ST, DB> for T
where T: Queryable<ST, DB>, ST: SqlTypeOrSelectable, DB: Backend, <T as Queryable<ST, DB>>::Row: FromStaticSqlRow<ST, DB>,

Source§

fn build_from_row<'a>( row: &impl Row<'a, DB>, ) -> Result<T, Box<dyn Error + Send + Sync>>

See the trait documentation.
Source§

impl<T, ST, DB> FromStaticSqlRow<ST, DB> for T
where DB: Backend, T: FromSql<ST, DB>, ST: SingleValue,

Source§

fn build_from_row<'a>( row: &impl Row<'a, DB>, ) -> Result<T, Box<dyn Error + Send + Sync>>

See the trait documentation
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

Source§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, ST, DB> StaticallySizedRow<ST, DB> for T
where ST: SqlTypeOrSelectable + TupleSize, T: Queryable<ST, DB>, DB: Backend,

Source§

const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE

The number of fields that this type will consume.
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> ToString for T
where T: Display + ?Sized,

§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<Z> Zeroize for Z
where Z: DefaultIsZeroes,

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> FromSqlOwned for T
where T: for<'a> FromSql<'a>,

Source§

impl<T> NumAssign for T
where T: Num + NumAssignOps,

Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,