TypeCommon

Trait TypeCommon 

Source
pub trait TypeCommon
where Self: Sized + Copy,
{ type Vec: VecTrait<Self> + Send + Copy + IntoVec<Self::Vec> + Index<usize, Output = Self> + IndexMut<usize> + Sync + Debug + NormalOutUnary + NormalOut<Self::Vec, Output = Self::Vec> + FloatOutUnary + FloatOutBinary + FloatOutBinary<<Self::Vec as FloatOutUnary>::Output, Output = <Self::Vec as FloatOutUnary>::Output>; const MAX: Self; const MIN: Self; const ZERO: Self; const ONE: Self; const INF: Self; const NEG_INF: Self; const TWO: Self; const SIX: Self; const TEN: Self; const STR: &'static str; const BYTE_SIZE: usize; }
Expand description

common trait for all data types

This trait is used to define the common properties of all data types

Required Associated Constants§

Source

const MAX: Self

the maximum value of the data type

Source

const MIN: Self

the minimum value of the data type

Source

const ZERO: Self

the zero value of the data type

Source

const ONE: Self

the one value of the data type

Source

const INF: Self

the infinity value of the data type, for integer types, it is the maximum value

Source

const NEG_INF: Self

the negative infinity value of the data type, for integer types, it is the minimum value

Source

const TWO: Self

the two value of the data type

Source

const SIX: Self

the six value of the data type

Source

const TEN: Self

the ten value of the data type

Source

const STR: &'static str

the string representation of the data type

Source

const BYTE_SIZE: usize

the bit size of the data type, alias of std::mem::size_of()

Required Associated Types§

Source

type Vec: VecTrait<Self> + Send + Copy + IntoVec<Self::Vec> + Index<usize, Output = Self> + IndexMut<usize> + Sync + Debug + NormalOutUnary + NormalOut<Self::Vec, Output = Self::Vec> + FloatOutUnary + FloatOutBinary + FloatOutBinary<<Self::Vec as FloatOutUnary>::Output, Output = <Self::Vec as FloatOutUnary>::Output>

the simd vector type of the data type

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TypeCommon for bool

Source§

const MAX: Self = true

Source§

const MIN: Self = false

Source§

const ZERO: Self = false

Source§

const ONE: Self = true

Source§

const INF: Self = true

Source§

const NEG_INF: Self = false

Source§

const TWO: Self = false

Source§

const SIX: Self = true

Source§

const TEN: Self = true

Source§

const STR: &'static str = "bool"

Source§

const BYTE_SIZE: usize = 1usize

Source§

type Vec = boolx16

Source§

impl TypeCommon for f32

Source§

const MAX: Self = 3.40282347E+38f32

Source§

const MIN: Self = -3.40282347E+38f32

Source§

const ZERO: Self = 0f32

Source§

const ONE: Self = 1f32

Source§

const INF: Self = +Inf_f32

Source§

const NEG_INF: Self = -Inf_f32

Source§

const TWO: Self = 2f32

Source§

const SIX: Self = 6f32

Source§

const TEN: Self = 10f32

Source§

const STR: &'static str = "f32"

Source§

const BYTE_SIZE: usize = 4usize

Source§

type Vec = f32x4

Source§

impl TypeCommon for f64

Source§

const MAX: Self = 1.7976931348623157E+308f64

Source§

const MIN: Self = -1.7976931348623157E+308f64

Source§

const ZERO: Self = 0f64

Source§

const ONE: Self = 1f64

Source§

const INF: Self = +Inf_f64

Source§

const NEG_INF: Self = -Inf_f64

Source§

const TWO: Self = 2f64

Source§

const SIX: Self = 6f64

Source§

const TEN: Self = 10f64

Source§

const STR: &'static str = "f64"

Source§

const BYTE_SIZE: usize = 8usize

Source§

type Vec = f64x2

Source§

impl TypeCommon for i8

Source§

const MAX: Self = 127i8

Source§

const MIN: Self = -128i8

Source§

const ZERO: Self = 0i8

Source§

const ONE: Self = 1i8

Source§

const INF: Self = 127i8

Source§

const NEG_INF: Self = -128i8

Source§

const TWO: Self = 2i8

Source§

const SIX: Self = 6i8

Source§

const TEN: Self = 10i8

Source§

const STR: &'static str = "i8"

Source§

const BYTE_SIZE: usize = 1usize

Source§

type Vec = i8x16

Source§

impl TypeCommon for i16

Source§

const MAX: Self = 32_767i16

Source§

const MIN: Self = -32_768i16

Source§

const ZERO: Self = 0i16

Source§

const ONE: Self = 1i16

Source§

const INF: Self = 32_767i16

Source§

const NEG_INF: Self = -32_768i16

Source§

const TWO: Self = 2i16

Source§

const SIX: Self = 6i16

Source§

const TEN: Self = 10i16

Source§

const STR: &'static str = "i16"

Source§

const BYTE_SIZE: usize = 2usize

Source§

type Vec = i16x8

Source§

impl TypeCommon for i32

Source§

const MAX: Self = 2_147_483_647i32

Source§

const MIN: Self = -2_147_483_648i32

Source§

const ZERO: Self = 0i32

Source§

const ONE: Self = 1i32

Source§

const INF: Self = 2_147_483_647i32

Source§

const NEG_INF: Self = -2_147_483_648i32

Source§

const TWO: Self = 2i32

Source§

const SIX: Self = 6i32

Source§

const TEN: Self = 10i32

Source§

const STR: &'static str = "i32"

Source§

const BYTE_SIZE: usize = 4usize

Source§

type Vec = i32x4

Source§

impl TypeCommon for i64

Source§

const MAX: Self = 9_223_372_036_854_775_807i64

Source§

const MIN: Self = -9_223_372_036_854_775_808i64

Source§

const ZERO: Self = 0i64

Source§

const ONE: Self = 1i64

Source§

const INF: Self = 9_223_372_036_854_775_807i64

Source§

const NEG_INF: Self = -9_223_372_036_854_775_808i64

Source§

const TWO: Self = 2i64

Source§

const SIX: Self = 6i64

Source§

const TEN: Self = 10i64

Source§

const STR: &'static str = "i64"

Source§

const BYTE_SIZE: usize = 8usize

Source§

type Vec = i64x2

Source§

impl TypeCommon for isize

Source§

const MAX: Self = 9_223_372_036_854_775_807isize

Source§

const MIN: Self = -9_223_372_036_854_775_808isize

Source§

const ZERO: Self = 0isize

Source§

const ONE: Self = 1isize

Source§

const INF: Self = 9_223_372_036_854_775_807isize

Source§

const NEG_INF: Self = -9_223_372_036_854_775_808isize

Source§

const TWO: Self = 2isize

Source§

const SIX: Self = 6isize

Source§

const TEN: Self = 10isize

Source§

const STR: &'static str = "isize"

Source§

const BYTE_SIZE: usize = 8usize

Source§

type Vec = isizex2

Source§

impl TypeCommon for u8

Source§

const MAX: Self = 255u8

Source§

const MIN: Self = 0u8

Source§

const ZERO: Self = 0u8

Source§

const ONE: Self = 1u8

Source§

const INF: Self = 255u8

Source§

const NEG_INF: Self = 0u8

Source§

const TWO: Self = 2u8

Source§

const SIX: Self = 6u8

Source§

const TEN: Self = 10u8

Source§

const STR: &'static str = "u8"

Source§

const BYTE_SIZE: usize = 1usize

Source§

type Vec = u8x16

Source§

impl TypeCommon for u16

Source§

const MAX: Self = 65_535u16

Source§

const MIN: Self = 0u16

Source§

const ZERO: Self = 0u16

Source§

const ONE: Self = 1u16

Source§

const INF: Self = 65_535u16

Source§

const NEG_INF: Self = 0u16

Source§

const TWO: Self = 2u16

Source§

const SIX: Self = 6u16

Source§

const TEN: Self = 10u16

Source§

const STR: &'static str = "u16"

Source§

const BYTE_SIZE: usize = 2usize

Source§

type Vec = u16x8

Source§

impl TypeCommon for u32

Source§

const MAX: Self = 4_294_967_295u32

Source§

const MIN: Self = 0u32

Source§

const ZERO: Self = 0u32

Source§

const ONE: Self = 1u32

Source§

const INF: Self = 4_294_967_295u32

Source§

const NEG_INF: Self = 0u32

Source§

const TWO: Self = 2u32

Source§

const SIX: Self = 6u32

Source§

const TEN: Self = 10u32

Source§

const STR: &'static str = "u32"

Source§

const BYTE_SIZE: usize = 4usize

Source§

type Vec = u32x4

Source§

impl TypeCommon for u64

Source§

const MAX: Self = 18_446_744_073_709_551_615u64

Source§

const MIN: Self = 0u64

Source§

const ZERO: Self = 0u64

Source§

const ONE: Self = 1u64

Source§

const INF: Self = 18_446_744_073_709_551_615u64

Source§

const NEG_INF: Self = 0u64

Source§

const TWO: Self = 2u64

Source§

const SIX: Self = 6u64

Source§

const TEN: Self = 10u64

Source§

const STR: &'static str = "u64"

Source§

const BYTE_SIZE: usize = 8usize

Source§

type Vec = u64x2

Source§

impl TypeCommon for usize

Source§

const MAX: Self = 18_446_744_073_709_551_615usize

Source§

const MIN: Self = 0usize

Source§

const ZERO: Self = 0usize

Source§

const ONE: Self = 1usize

Source§

const INF: Self = 18_446_744_073_709_551_615usize

Source§

const NEG_INF: Self = 0usize

Source§

const TWO: Self = 2usize

Source§

const SIX: Self = 6usize

Source§

const TEN: Self = 10usize

Source§

const STR: &'static str = "usize"

Source§

const BYTE_SIZE: usize = 8usize

Source§

type Vec = usizex2

Source§

impl TypeCommon for bf16

Source§

const MAX: Self = bf16::MAX

Source§

const MIN: Self = bf16::MIN

Source§

const ZERO: Self = bf16::ZERO

Source§

const ONE: Self = bf16::ONE

Source§

const INF: Self = bf16::INFINITY

Source§

const NEG_INF: Self = bf16::NEG_INFINITY

Source§

const TWO: Self

Source§

const SIX: Self

Source§

const TEN: Self

Source§

const STR: &'static str = "bf16"

Source§

const BYTE_SIZE: usize = 2usize

Source§

type Vec = bf16x8

Source§

impl TypeCommon for f16

Source§

const MAX: Self = f16::MAX

Source§

const MIN: Self = f16::MIN

Source§

const ZERO: Self = f16::ZERO

Source§

const ONE: Self = f16::ONE

Source§

const INF: Self = f16::INFINITY

Source§

const NEG_INF: Self = f16::NEG_INFINITY

Source§

const TWO: Self

Source§

const SIX: Self

Source§

const TEN: Self

Source§

const STR: &'static str = "f16"

Source§

const BYTE_SIZE: usize = 2usize

Source§

type Vec = f16x8

Source§

impl TypeCommon for Complex32

Source§

const MAX: Self

Source§

const MIN: Self

Source§

const ZERO: Self

Source§

const ONE: Self

Source§

const INF: Self

Source§

const NEG_INF: Self

Source§

const TWO: Self

Source§

const SIX: Self

Source§

const TEN: Self

Source§

const STR: &'static str = "c32"

Source§

const BYTE_SIZE: usize = 8usize

Source§

type Vec = cplx32x2

Source§

impl TypeCommon for Complex64

Source§

const MAX: Self

Source§

const MIN: Self

Source§

const ZERO: Self

Source§

const ONE: Self

Source§

const INF: Self

Source§

const NEG_INF: Self

Source§

const TWO: Self

Source§

const SIX: Self

Source§

const TEN: Self

Source§

const STR: &'static str = "c64"

Source§

const BYTE_SIZE: usize = 16usize

Source§

type Vec = cplx64x1

Implementors§