Decimal128

Struct Decimal128 

Source
pub struct Decimal128(/* private fields */);

Implementations§

Source§

impl Decimal128

Source

pub fn zero() -> Self

Returns new Decimal128 set to zero.

Source

pub fn negative_zero() -> Self

Returns new Decimal128 set to negative zero.

Source

pub fn abs(&self) -> Self

Returns the absolute value of this Decimal128.

Source

pub fn is_negative(&self) -> bool

Returns true if this Decimal128 is less than zero and not a NaN, or false otherwise.

Source

pub fn is_signed(&self) -> bool

Returns true if this Decimal128 has a sign, or false otherwise. Note that zeros and NaNs may also have a sign.

Source

pub fn is_zero(&self) -> bool

Returns true if this Decimal128 is a zero, or false otherwise.

Source

pub fn is_nan(&self) -> bool

Returns true if this Decimal128 is a NaN (quiet or signaling), or false otherwise.

Trait Implementations§

Source§

impl Debug for Decimal128

Source§

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

Converts Decimal128 to a string in the form of hexadecimal bytes separated with spaces.

Source§

impl Default for Decimal128

Source§

fn default() -> Self

The default value for Decimal128 is positive zero.

Source§

impl From<&str> for Decimal128

Source§

fn from(s: &str) -> Self

Returns a Decimal128 initialized from string slice value.

Source§

impl From<i16> for Decimal128

Source§

fn from(n: i16) -> Self

Returns a Decimal128 initialized from i16 value.

Source§

impl From<i32> for Decimal128

Source§

fn from(n: i32) -> Self

Returns a Decimal128 initialized from i32 value.

Source§

impl From<i64> for Decimal128

Source§

fn from(n: i64) -> Self

Returns a Decimal128 initialized from i64 value.

Source§

impl From<i8> for Decimal128

Source§

fn from(n: i8) -> Self

Returns a Decimal128 initialized from i8 value.

Source§

impl From<u16> for Decimal128

Source§

fn from(n: u16) -> Self

Returns a Decimal128 initialized from u16 value.

Source§

impl From<u32> for Decimal128

Source§

fn from(n: u32) -> Self

Returns a Decimal128 initialized from u32 value.

Source§

impl From<u64> for Decimal128

Source§

fn from(n: u64) -> Self

Returns a Decimal128 initialized from u64 value.

Source§

impl From<u8> for Decimal128

Source§

fn from(n: u8) -> Self

Returns a Decimal128 initialized from u8 value.

Auto Trait Implementations§

Blanket Implementations§

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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