Struct gtmpl_value::Number[][src]

pub struct Number { /* fields omitted */ }

Internal number format for gtmpl_value.

Methods

impl Number
[src]

use std::i64;
use gtmpl_value::Number;

let big: Number = (i64::MAX as u64 + 10).into();

assert!(big.as_u64().is_some());
assert!(big.as_i64().is_none());
assert!(big.as_f64().is_none());

use std::i64;
use gtmpl_value::Number;

let neg: Number = (-10).into();

assert!(neg.as_u64().is_none());
assert!(neg.as_i64().is_some());
assert!(neg.as_f64().is_some());

use std::i64;
use gtmpl_value::Number;

let frac: Number = (10.1).into();

assert!(frac.as_u64().is_none());
assert!(frac.as_i64().is_none());
assert!(frac.as_f64().is_some());

Trait Implementations

impl Debug for Number
[src]

Formats the value using the given formatter. Read more

impl Clone for Number
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Number
[src]

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

This method tests for !=.

impl PartialOrd for Number
[src]

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

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Display for Number
[src]

Formats the value using the given formatter. Read more

impl From<i64> for Number
[src]

Performs the conversion.

impl From<i32> for Number
[src]

Performs the conversion.

impl From<i16> for Number
[src]

Performs the conversion.

impl From<i8> for Number
[src]

Performs the conversion.

impl From<isize> for Number
[src]

Performs the conversion.

impl From<u64> for Number
[src]

Performs the conversion.

impl From<u32> for Number
[src]

Performs the conversion.

impl From<u16> for Number
[src]

Performs the conversion.

impl From<u8> for Number
[src]

Performs the conversion.

impl From<usize> for Number
[src]

Performs the conversion.

impl From<f64> for Number
[src]

Performs the conversion.

impl From<f32> for Number
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Number

impl Sync for Number