[][src]Struct clickhouse_rs::types::Decimal

pub struct Decimal { /* fields omitted */ }

Provides arbitrary-precision floating point decimal.

Methods

impl Decimal[src]

pub fn of<B: Base>(source: B, scale: u8) -> Decimal[src]

Method of creating a Decimal.

pub fn internal<I: InternalResult>(&self) -> I[src]

Get the internal representation of decimal as i32 or i64.

example:

    .and_then(move |c| c.query("SELECT toDecimal32(2, 4) AS x").fetch_all())
    .and_then(move |(_, block)| {
        let x: Decimal = block.get(0, "x")?;
        let actual: i32 = x.internal();
        assert_eq!(20000, actual);
    })

pub fn scale(&self) -> usize[src]

Determines how many decimal digits fraction can have.

Trait Implementations

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

impl Clone for Decimal[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for Decimal[src]

impl From<Decimal> for f32[src]

impl From<Decimal> for f64[src]

impl PartialEq<Decimal> for Decimal[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Display for Decimal[src]

impl Debug for Decimal[src]

Auto Trait Implementations

impl Sync for Decimal

impl Send for Decimal

impl Unpin for Decimal

impl RefUnwindSafe for Decimal

impl UnwindSafe for Decimal

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T