Skip to main content

Number

Trait Number 

Source
pub trait Number:
    Add<Output = Self>
    + Sub<Output = Self>
    + Copy
    + Clone
    + PartialOrd
    + PartialEq
    + Display
    + FromStr {
    // Required methods
    fn write_to_string(
        &self,
        writer: &mut String,
        format: impl Into<NumberFormat>,
    );
    fn to_f64(&self) -> f64;
    fn from_f64(v: f64) -> Self;
}

Required Methods§

Source

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source

fn to_f64(&self) -> f64

Source

fn from_f64(v: f64) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Number for f32

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for f64

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for i8

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for i16

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for i32

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for i64

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for i128

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for isize

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for u8

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for u16

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for u32

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for u64

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for u128

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl Number for usize

Source§

fn write_to_string(&self, writer: &mut String, format: impl Into<NumberFormat>)

Source§

fn to_f64(&self) -> f64

Source§

fn from_f64(v: f64) -> Self

Implementors§