binius_field::underlier

Trait NumCast

Source
pub trait NumCast<From> {
    // Required method
    fn num_cast_from(val: From) -> Self;
}
Expand description

A trait that represents potentially lossy numeric cast. Is a drop-in replacement of as _ in a generic code.

Required Methods§

Source

fn num_cast_from(val: From) -> Self

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 NumCast<u8> for u16

Source§

fn num_cast_from(val: u8) -> Self

Source§

impl NumCast<u8> for u32

Source§

fn num_cast_from(val: u8) -> Self

Source§

impl NumCast<u8> for u64

Source§

fn num_cast_from(val: u8) -> Self

Source§

impl NumCast<u8> for u128

Source§

fn num_cast_from(val: u8) -> Self

Source§

impl NumCast<u16> for u8

Source§

fn num_cast_from(val: u16) -> Self

Source§

impl NumCast<u16> for u32

Source§

fn num_cast_from(val: u16) -> Self

Source§

impl NumCast<u16> for u64

Source§

fn num_cast_from(val: u16) -> Self

Source§

impl NumCast<u16> for u128

Source§

fn num_cast_from(val: u16) -> Self

Source§

impl NumCast<u32> for u8

Source§

fn num_cast_from(val: u32) -> Self

Source§

impl NumCast<u32> for u16

Source§

fn num_cast_from(val: u32) -> Self

Source§

impl NumCast<u32> for u64

Source§

fn num_cast_from(val: u32) -> Self

Source§

impl NumCast<u32> for u128

Source§

fn num_cast_from(val: u32) -> Self

Source§

impl NumCast<u64> for u8

Source§

fn num_cast_from(val: u64) -> Self

Source§

impl NumCast<u64> for u16

Source§

fn num_cast_from(val: u64) -> Self

Source§

impl NumCast<u64> for u32

Source§

fn num_cast_from(val: u64) -> Self

Source§

impl NumCast<u64> for u128

Source§

fn num_cast_from(val: u64) -> Self

Source§

impl NumCast<u128> for u8

Source§

fn num_cast_from(val: u128) -> Self

Source§

impl NumCast<u128> for u16

Source§

fn num_cast_from(val: u128) -> Self

Source§

impl NumCast<u128> for u32

Source§

fn num_cast_from(val: u128) -> Self

Source§

impl NumCast<u128> for u64

Source§

fn num_cast_from(val: u128) -> Self

Source§

impl NumCast<SmallU<1>> for u8

Source§

fn num_cast_from(val: U1) -> Self

Source§

impl NumCast<SmallU<1>> for u16

Source§

fn num_cast_from(val: U1) -> Self

Source§

impl NumCast<SmallU<1>> for u32

Source§

fn num_cast_from(val: U1) -> Self

Source§

impl NumCast<SmallU<1>> for u64

Source§

fn num_cast_from(val: U1) -> Self

Source§

impl NumCast<SmallU<1>> for u128

Source§

fn num_cast_from(val: U1) -> Self

Source§

impl NumCast<SmallU<2>> for u8

Source§

fn num_cast_from(val: U2) -> Self

Source§

impl NumCast<SmallU<2>> for u16

Source§

fn num_cast_from(val: U2) -> Self

Source§

impl NumCast<SmallU<2>> for u32

Source§

fn num_cast_from(val: U2) -> Self

Source§

impl NumCast<SmallU<2>> for u64

Source§

fn num_cast_from(val: U2) -> Self

Source§

impl NumCast<SmallU<2>> for u128

Source§

fn num_cast_from(val: U2) -> Self

Source§

impl NumCast<SmallU<4>> for u8

Source§

fn num_cast_from(val: U4) -> Self

Source§

impl NumCast<SmallU<4>> for u16

Source§

fn num_cast_from(val: U4) -> Self

Source§

impl NumCast<SmallU<4>> for u32

Source§

fn num_cast_from(val: U4) -> Self

Source§

impl NumCast<SmallU<4>> for u64

Source§

fn num_cast_from(val: U4) -> Self

Source§

impl NumCast<SmallU<4>> for u128

Source§

fn num_cast_from(val: U4) -> Self

Implementors§