Trait tinychain::scalar::NumberClass[]

pub trait NumberClass: Default + Into<NumberType> + Ord + Send + Display {
    type Instance: NumberInstance;
    fn cast(&self, n: Number) -> Self::Instance;
fn size(self) -> usize;
fn one(&self) -> Self::Instance;
fn zero(&self) -> Self::Instance; }
Expand description

Defines common properties of numeric types supported by Number.

Associated Types

Loading content...

Required methods

fn cast(&self, n: Number) -> Self::Instance

fn size(self) -> usize

fn one(&self) -> Self::Instance

fn zero(&self) -> Self::Instance

Loading content...

Implementors

impl NumberClass for ComplexType

type Instance = Complex

pub fn cast(&self, n: Number) -> Complex

pub fn size(self) -> usize

pub fn one(&self) -> Complex

pub fn zero(&self) -> Complex

impl NumberClass for FloatType

type Instance = Float

pub fn cast(&self, n: Number) -> Float

pub fn size(self) -> usize

pub fn one(&self) -> Float

pub fn zero(&self) -> Float

impl NumberClass for IntType

type Instance = Int

pub fn cast(&self, n: Number) -> Int

pub fn size(self) -> usize

pub fn one(&self) -> Int

pub fn zero(&self) -> Int

impl NumberClass for NumberType

type Instance = Number

pub fn cast(&self, n: Number) -> Number

pub fn size(self) -> usize

pub fn one(&self) -> Number

pub fn zero(&self) -> Number

impl NumberClass for UIntType

type Instance = UInt

pub fn cast(&self, n: Number) -> UInt

pub fn size(self) -> usize

pub fn one(&self) -> UInt

pub fn zero(&self) -> UInt

impl NumberClass for BooleanType

type Instance = Boolean

pub fn cast(&self, n: Number) -> Boolean

pub fn size(self) -> usize

pub fn one(&self) -> Boolean

pub fn zero(&self) -> Boolean

Loading content...