Skip to main content

Repr

Struct Repr 

Source
pub struct Repr<const BASE: Word> { /* private fields */ }
Expand description

Underlying representation of an arbitrary precision floating number.

The floating point number is represented as significand * base^exponent, where the type of the significand is IBig, and the type of exponent is isize. The representation is always normalized (nonzero signficand is not divisible by the base, or zero signficand with zero exponent).

When it’s used together with a Context, its precision will be limited so that |significand| < base^precision. As an intentional exception, the result of an inexact addition or subtraction may carry one extra guard digit, so |significand| can be up to base^(precision+1); the guard digit is what lets a much-smaller operand be reduced to a sign-only sticky bit during alignment without mis-rounding.

§Infinity and signed zero

Special values are encoded with a zero significand and a sentinel exponent:

  • value zero (+0): exponent = 0
  • negative zero (-0): exponent = -1
  • positive infinity (+inf): exponent = isize::MAX
  • negative infinity (-inf): exponent = isize::MIN

The infinities are only supposed to be consumed as sentinels: only equality test and comparison are implemented for them, and any arithmetic operation that takes an infinity as input will lead to panic (at the FBig layer) or return an error (at the Context layer). If an operation result is too large or too small, the operation will return an infinity (as a value) at the Context layer, or panic at the FBig layer.

Implementations§

Source§

impl<const B: Word> Repr<B>

Source

pub fn to_f32(&self) -> Rounded<f32>

Convert the float number representation to a f32 with the default IEEE 754 rounding mode.

The default IEEE 754 rounding mode is HalfEven (rounding to nearest, ties to even). To convert the float number with a specific rounding mode, please use FBig::to_f32.

§Examples
assert_eq!(Repr::<2>::one().to_f32(), Exact(1.0));
assert_eq!(Repr::<10>::infinity().to_f32(), Inexact(f32::INFINITY, NoOp));
Source

pub fn to_f64(&self) -> Rounded<f64>

Convert the float number representation to a f64 with the default IEEE 754 rounding mode.

The default IEEE 754 rounding mode is HalfEven (rounding to nearest, ties to even). To convert the float number with a specific rounding mode, please use FBig::to_f64.

§Examples
assert_eq!(Repr::<2>::one().to_f64(), Exact(1.0));
assert_eq!(Repr::<10>::infinity().to_f64(), Inexact(f64::INFINITY, NoOp));
Source

pub fn to_int(&self) -> Rounded<IBig>

Convert the float number representation to a IBig.

The fractional part is always rounded to zero. To convert with other rounding modes, please use FBig::to_int().

§Warning

If the float number has a very large exponent, it will be evaluated and result in allocating an huge integer and it might eat up all your memory.

To get a rough idea of how big the number is, it’s recommended to use EstimatedLog2.

§Examples
assert_eq!(Repr::<2>::neg_one().to_int(), Exact(IBig::NEG_ONE));
§Panics

Panics if the number is infinte.

Source§

impl<const B: Word> Repr<B>

Source

pub const BASE: UBig

The base of the representation. It’s exposed as an IBig constant.

Source

pub const fn zero() -> Self

Create a Repr instance representing value zero

Source

pub const fn one() -> Self

Create a Repr instance representing value one

Source

pub const fn neg_one() -> Self

Create a Repr instance representing value negative one

Source

pub const fn infinity() -> Self

Create a Repr instance representing the (positive) infinity

Source

pub const fn neg_infinity() -> Self

Create a Repr instance representing the negative infinity

Source

pub const fn neg_zero() -> Self

Create a Repr instance representing the negative zero (-0)

Negative zero is produced by operations (e.g. 1 / -inf, ceil(-0), cancellation under round-toward-negative) and is distinct from +0 only in operations that are sensitive to the sign of zero (e.g. 1 / -0 = -inf). It compares equal to +0.

Source

pub const fn is_pos_zero(&self) -> bool

Determine if the Repr represents positive zero (+0)

This returns true only for +0; use Self::is_neg_zero to detect -0, or check self.significand().is_zero() to detect either signed zero.

§Examples
assert!(Repr::<2>::zero().is_pos_zero());
assert!(!Repr::<10>::neg_zero().is_pos_zero());
assert!(!Repr::<10>::one().is_pos_zero());
Source

pub const fn is_neg_zero(&self) -> bool

Determine if the Repr represents the negative zero (-0)

§Examples
assert!(Repr::<2>::neg_zero().is_neg_zero());
assert!(!Repr::<10>::zero().is_neg_zero());
assert!(!Repr::<10>::one().is_neg_zero());
Source

pub const fn is_one(&self) -> bool

Determine if the Repr represents one

§Examples
assert!(Repr::<2>::zero().is_pos_zero());
assert!(!Repr::<10>::one().is_pos_zero());
Source

pub const fn is_infinite(&self) -> bool

Determine if the Repr represents the (±)infinity

§Examples
assert!(Repr::<2>::infinity().is_infinite());
assert!(Repr::<10>::neg_infinity().is_infinite());
assert!(!Repr::<10>::one().is_infinite());
assert!(!Repr::<10>::neg_zero().is_infinite());
Source

pub const fn is_finite(&self) -> bool

Determine if the Repr represents a finite number

§Examples
assert!(Repr::<2>::zero().is_finite());
assert!(Repr::<10>::one().is_finite());
assert!(!Repr::<16>::infinity().is_finite());
Source

pub fn is_int(&self) -> bool

Determine if the number can be regarded as an integer.

Note that this function returns false when the number is infinite.

§Examples
assert!(Repr::<2>::zero().is_int());
assert!(Repr::<10>::one().is_int());
assert!(!Repr::<16>::new(123.into(), -1).is_int());
Source

pub const fn sign(&self) -> Sign

Get the sign of the number

Note that -0 has a negative sign (so 1 / -0 = -inf), while +0 has a positive sign.

§Examples
assert_eq!(Repr::<2>::zero().sign(), Sign::Positive);
assert_eq!(Repr::<2>::neg_zero().sign(), Sign::Negative);
assert_eq!(Repr::<2>::neg_one().sign(), Sign::Negative);
assert_eq!(Repr::<10>::neg_infinity().sign(), Sign::Negative);
Source

pub fn digits(&self) -> usize

Get the number of digits (under base B) in the significand.

If the number is 0, then 0 is returned (instead of 1).

§Examples
assert_eq!(Repr::<2>::zero().digits(), 0);
assert_eq!(Repr::<2>::one().digits(), 1);
assert_eq!(Repr::<10>::one().digits(), 1);

assert_eq!(Repr::<10>::new(100.into(), 0).digits(), 1); // 1e2
assert_eq!(Repr::<10>::new(101.into(), 0).digits(), 3);
Source

pub fn digits_ub(&self) -> usize

Fast over-estimation of digits

§Examples
assert_eq!(Repr::<2>::zero().digits_ub(), 0);
assert_eq!(Repr::<2>::one().digits_ub(), 1);
assert_eq!(Repr::<10>::one().digits_ub(), 1);
assert_eq!(Repr::<2>::new(31.into(), 0).digits_ub(), 5);
assert_eq!(Repr::<10>::new(99.into(), 0).digits_ub(), 2);
Source

pub fn digits_lb(&self) -> usize

Fast under-estimation of digits

§Examples
assert_eq!(Repr::<2>::zero().digits_lb(), 0);
assert_eq!(Repr::<2>::one().digits_lb(), 0);
assert_eq!(Repr::<10>::one().digits_lb(), 0);
assert!(Repr::<10>::new(1001.into(), 0).digits_lb() <= 3);
Source

pub fn new(significand: IBig, exponent: isize) -> Self

Create a Repr from the significand and exponent. This constructor will normalize the representation.

§Examples
let a = Repr::<2>::new(400.into(), -2);
assert_eq!(a.significand(), &IBig::from(25));
assert_eq!(a.exponent(), 2);

let b = Repr::<10>::new(400.into(), -2);
assert_eq!(b.significand(), &IBig::from(4));
assert_eq!(b.exponent(), 0);
Source

pub fn significand(&self) -> &IBig

Get the significand of the representation

Source

pub fn exponent(&self) -> isize

Get the exponent of the representation

Source

pub fn into_parts(self) -> (IBig, isize)

Convert the float number into raw (signficand, exponent) parts

§Examples
use dashu_int::IBig;

let a = Repr::<2>::new(400.into(), -2);
assert_eq!(a.into_parts(), (IBig::from(25), 2));

let b = Repr::<10>::new(400.into(), -2);
assert_eq!(b.into_parts(), (IBig::from(4), 0));
Source§

impl<const B: Word> Repr<B>

Source

pub fn num_hash_residue(&self) -> i128

The numeric-hash residue (mod 2¹²⁷−1) used by NumHash: sgn(significand) · (|significand| mod M127) · (B^exponent mod M127).

Special values: +00, -00, +∞HASH_INF (= M127), -∞HASH_NEGINF (= -M127), matching num-order’s f64::fhash. The subsequent i128::num_hash maps both HASH_INF and HASH_NEGINF back to 0, so the final hash of ±∞ is 0 — but the residue distinguishes them so that composite types (e.g. CBig) combine them algebraically the same way num-order’s Complex<f64> does.

Trait Implementations§

Source§

impl<const B: Word> AbsOrd<IBig> for Repr<B>

Source§

fn abs_cmp(&self, other: &IBig) -> Ordering

Compare the magnitude of self against the magnitude of rhs.
Source§

impl<const B: Word> AbsOrd<Repr<B>> for UBig

Source§

fn abs_cmp(&self, other: &Repr<B>) -> Ordering

Compare the magnitude of self against the magnitude of rhs.
Source§

impl<const B: Word> AbsOrd<Repr<B>> for IBig

Source§

fn abs_cmp(&self, other: &Repr<B>) -> Ordering

Compare the magnitude of self against the magnitude of rhs.
Source§

impl<const B: Word> AbsOrd<UBig> for Repr<B>

Source§

fn abs_cmp(&self, other: &UBig) -> Ordering

Compare the magnitude of self against the magnitude of rhs.
Source§

impl Binary for Repr<2>

Source§

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

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

impl<const B: Word> Clone for Repr<B>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
Source§

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

Performs copy-assignment from source. Read more
Source§

impl<const B: Word> Debug for Repr<B>

Source§

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

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

impl<'de, const B: Word> Deserialize<'de> for Repr<B>

Source§

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

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

impl<const B: Word> Display for Repr<B>

Source§

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

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

impl<const B: Word> Eq for Repr<B>

Source§

impl<const B: Word> EstimatedLog2 for Repr<B>

Source§

fn log2_bounds(&self) -> (f32, f32)

Estimate the bounds of the binary logarithm. Read more
Source§

fn log2_est(&self) -> f32

Estimate the value of the binary logarithm. It’s calculated as the average of log2_bounds by default.
Source§

impl<const B: Word> From<IBig> for Repr<B>

Source§

fn from(n: IBig) -> Self

Converts to this type from the input type.
Source§

impl<const B: Word> From<UBig> for Repr<B>

Source§

fn from(n: UBig) -> Self

Converts to this type from the input type.
Source§

impl<const B: Word> From<u8> for Repr<B>

Source§

fn from(value: u8) -> Repr<B>

Converts to this type from the input type.
Source§

impl<const B: Word> From<u16> for Repr<B>

Source§

fn from(value: u16) -> Repr<B>

Converts to this type from the input type.
Source§

impl<const B: Word> From<u32> for Repr<B>

Source§

fn from(value: u32) -> Repr<B>

Converts to this type from the input type.
Source§

impl<const B: Word> From<u64> for Repr<B>

Source§

fn from(value: u64) -> Repr<B>

Converts to this type from the input type.
Source§

impl<const B: Word> From<u128> for Repr<B>

Source§

fn from(value: u128) -> Repr<B>

Converts to this type from the input type.
Source§

impl<const B: Word> From<usize> for Repr<B>

Source§

fn from(value: usize) -> Repr<B>

Converts to this type from the input type.
Source§

impl<'a> FromSql<'a> for Repr<10>

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( ty: &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 from_sql_null(ty: &Type) -> Result<Self, Box<dyn Error + Sync + Send>>

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 + Sync + Send>>

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

impl FromSql<Numeric, Pg> for Repr<10>

Source§

fn from_sql(bytes: Option<&[u8]>) -> Result<Self>

See the trait documentation.
Source§

impl FromSql<Numeric, Pg> for Repr<10>

Source§

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

See the trait documentation.
Source§

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

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

impl<const B: Word> LowerExp for Repr<B>

Source§

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

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

impl LowerHex for Repr<2>

Source§

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

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

impl LowerHex for Repr<16>

Source§

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

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

impl<const B: Word> Neg for Repr<B>

Source§

type Output = Repr<B>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<const B: Word> NumHash for Repr<B>

Source§

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

Consistent Hash::hash on different numeric types. Read more
Source§

impl<const B: Word> NumOrd<IBig> for Repr<B>

Source§

fn num_cmp(&self, other: &IBig) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

fn num_partial_cmp(&self, other: &IBig) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

impl<const B1: Word, const B2: Word> NumOrd<Repr<B2>> for Repr<B1>

Source§

fn num_cmp(&self, other: &Repr<B2>) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

fn num_partial_cmp(&self, other: &Repr<B2>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

impl<const B: Word> NumOrd<Repr<B>> for UBig

Source§

fn num_cmp(&self, other: &Repr<B>) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

impl<const B: Word> NumOrd<Repr<B>> for IBig

Source§

fn num_cmp(&self, other: &Repr<B>) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

impl<const B: Word> NumOrd<Repr<B>> for u8

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for u16

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for u32

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for u64

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for u128

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for usize

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for i8

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for i16

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for i32

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for i64

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for i128

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for isize

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for f32

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<Repr<B>> for f64

Source§

fn num_partial_cmp(&self, other: &Repr<B>) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<UBig> for Repr<B>

Source§

fn num_cmp(&self, other: &UBig) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

fn num_partial_cmp(&self, other: &UBig) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

impl<const B: Word> NumOrd<f32> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &f32) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<f64> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &f64) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<i8> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &i8) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<i16> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &i16) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<i32> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &i32) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<i64> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &i64) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<i128> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &i128) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<isize> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &isize) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<u8> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &u8) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<u16> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &u16) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<u32> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &u32) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<u64> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &u64) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<u128> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &u128) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl<const B: Word> NumOrd<usize> for Repr<B>

Source§

fn num_partial_cmp(&self, other: &usize) -> Option<Ordering>

PartialOrd::partial_cmp on different numeric types
Source§

fn num_eq(&self, other: &Other) -> bool

PartialEq::eq on different numeric types
Source§

fn num_ne(&self, other: &Other) -> bool

PartialEq::ne on different numeric types
Source§

fn num_lt(&self, other: &Other) -> bool

PartialOrd::lt on different numeric types
Source§

fn num_le(&self, other: &Other) -> bool

PartialOrd::le on different numeric types
Source§

fn num_gt(&self, other: &Other) -> bool

PartialOrd::gt on different numeric types
Source§

fn num_ge(&self, other: &Other) -> bool

PartialOrd::ge on different numeric types
Source§

fn num_cmp(&self, other: &Other) -> Ordering

Ord::cmp on different numeric types. It panics if either of the numeric values contains NaN.
Source§

impl Octal for Repr<8>

Source§

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

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

impl<const B: Word> Ord for Repr<B>

Source§

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

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

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

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

impl<const B: Word> PartialEq for Repr<B>

Source§

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

Two representations are equal when they denote the same value. In particular +0 and -0 compare equal, as do two infinities of the same sign.

1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<const B: Word> PartialOrd for Repr<B>

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

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

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 (const: unstable) · Source§

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

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

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 B: Word> Serialize for Repr<B>

Source§

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

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

impl ToSql for Repr<10>

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( &self, ty: &Type, out: &mut BytesMut, ) -> Result<IsNull, Box<dyn Error + Sync + Send>>

Converts the value of self into the binary format of the specified Postgres Type, appending it to out. Read more
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 ToSql<Numeric, Pg> for Repr<10>

Source§

fn to_sql<W: Write>(&self, out: &mut Output<'_, W, Pg>) -> Result

See the trait documentation.
Source§

impl ToSql<Numeric, Pg> for Repr<10>

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

See the trait documentation.
Source§

impl TryFrom<Repr<2>> for f32

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Repr<2>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Repr<2>> for f64

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Repr<2>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const B: Word> TryFrom<Repr<B>> for u8

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Repr<B>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const B: Word> TryFrom<Repr<B>> for u16

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Repr<B>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const B: Word> TryFrom<Repr<B>> for u32

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Repr<B>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const B: Word> TryFrom<Repr<B>> for u64

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Repr<B>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const B: Word> TryFrom<Repr<B>> for u128

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Repr<B>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const B: Word> TryFrom<Repr<B>> for usize

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Repr<B>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<f32> for Repr<2>

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(f: f32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<f64> for Repr<2>

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(f: f64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const B: Word> UpperExp for Repr<B>

Source§

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

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

impl UpperHex for Repr<2>

Source§

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

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

impl UpperHex for Repr<16>

Source§

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

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

impl<const B: Word> Zeroize for Repr<B>

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.

Auto Trait Implementations§

§

impl<const BASE: u64> Freeze for Repr<BASE>

§

impl<const BASE: u64> RefUnwindSafe for Repr<BASE>

§

impl<const BASE: u64> Send for Repr<BASE>

§

impl<const BASE: u64> Sync for Repr<BASE>

§

impl<const BASE: u64> Unpin for Repr<BASE>

§

impl<const BASE: u64> UnsafeUnpin for Repr<BASE>

§

impl<const BASE: u64> UnwindSafe for Repr<BASE>

Blanket Implementations§

Source§

impl<T> AggregateExpressionMethods for T

Source§

fn aggregate_distinct(self) -> Self::Output
where Self: DistinctDsl,

DISTINCT modifier for aggregate functions Read more
Source§

fn aggregate_all(self) -> Self::Output
where Self: AllDsl,

ALL modifier for aggregate functions Read more
Source§

fn aggregate_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add an aggregate function filter Read more
Source§

fn aggregate_order<O>(self, o: O) -> Self::Output
where Self: OrderAggregateDsl<O>,

Add an aggregate function order Read more
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromSqlOwned for T
where T: for<'a> FromSql<'a>,

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 + Sync + Send>>

See the trait documentation
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

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> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression
where Self: Sized + AsExpression<T>,

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>,

Convert &self to an expression for Diesel’s query builder. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WindowExpressionMethods for T

Source§

fn over(self) -> Self::Output
where Self: OverDsl,

Turn a function call into a window function call Read more
Source§

fn window_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add a filter to the current window function Read more
Source§

fn partition_by<E>(self, expr: E) -> Self::Output
where Self: PartitionByDsl<E>,

Add a partition clause to the current window function Read more
Source§

fn window_order<E>(self, expr: E) -> Self::Output
where Self: OrderWindowDsl<E>,

Add a order clause to the current window function Read more
Source§

fn frame_by<E>(self, expr: E) -> Self::Output
where Self: FrameDsl<E>,

Add a frame clause to the current window function Read more