[][src]Struct tiberius::numeric::Numeric

pub struct Numeric { /* fields omitted */ }

Represent a sql Decimal / Numeric type. It is stored in a i128 and has a maximum precision of 38 decimals.

A recommended way of dealing with numeric values is by enabling the rust_decimal feature and using its Decimal type instead.

Implementations

impl Numeric[src]

pub fn new_with_scale(value: i128, scale: u8) -> Self[src]

Creates a new Numeric value.

Panic

It will panic if the scale exceed 37.

pub fn dec_part(self) -> i128[src]

Extract the decimal part.

pub fn int_part(self) -> i128[src]

Extract the integer part.

pub fn scale(self) -> u8[src]

The scale (where is the decimal point) of the value.

pub fn value(self) -> i128[src]

The internal integer value

pub fn precision(self) -> u8[src]

The precision of the Number as a number of digits.

Trait Implementations

impl Clone for Numeric[src]

impl Copy for Numeric[src]

impl Debug for Numeric[src]

impl Display for Numeric[src]

impl Eq for Numeric[src]

impl From<Numeric> for f64[src]

impl From<Numeric> for i128[src]

impl From<Numeric> for u128[src]

impl<'a> FromSql<'a> for Numeric[src]

impl FromSqlOwned for Numeric[src]

impl PartialEq<Numeric> for Numeric[src]

impl ToSql for Numeric[src]

Auto Trait Implementations

impl RefUnwindSafe for Numeric

impl Send for Numeric

impl Sync for Numeric

impl Unpin for Numeric

impl UnwindSafe for Numeric

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,