pub enum PgNumeric {
    Positive {
        weight: i16,
        scale: u16,
        digits: Vec<i16>,
    },
    Negative {
        weight: i16,
        scale: u16,
        digits: Vec<i16>,
    },
    NaN,
}
Available on crate feature postgres_backend only.
Expand description

Represents a NUMERIC value, closely mirroring the PG wire protocol representation

Variants

Positive

Fields

weight: i16

How many digits come before the decimal point?

scale: u16

How many significant digits are there?

digits: Vec<i16>

The digits in this number, stored in base 10000

A positive number

Negative

Fields

weight: i16

How many digits come before the decimal point?

scale: u16

How many significant digits are there?

digits: Vec<i16>

The digits in this number, stored in base 10000

A negative number

NaN

Not a number

Trait Implementations

The expression being returned

Perform the conversion

The expression being returned

Perform the conversion

The expression being returned

Perform the conversion

The expression being returned

Perform the conversion

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

See the trait documentation.

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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

Construct an instance of this type

See the trait documentation.

See the trait documentation.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

See the trait documentation.

See the trait documentation

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert self to an expression for Diesel’s query builder. Read more

Convert &self to an expression for Diesel’s query builder. Read more

The number of fields that this type will consume.

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.