Skip to main content

Widen

Trait Widen 

Source
pub trait Widen<T> {
    // Required method
    fn widen(self) -> T;
}
Expand description

Lossless integer conversions that std provides no From impl for (for example NonZeroU16 or usize into u64).

Required Methods§

Source

fn widen(self) -> T

Convert without loss.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Widen<u16> for NonZeroU8

Source§

fn widen(self) -> u16

Source§

impl Widen<u32> for NonZeroU8

Source§

fn widen(self) -> u32

Source§

impl Widen<u32> for NonZeroU16

Source§

fn widen(self) -> u32

Source§

impl Widen<u64> for NonZeroU8

Source§

fn widen(self) -> u64

Source§

impl Widen<u64> for NonZeroU16

Source§

fn widen(self) -> u64

Source§

impl Widen<u64> for NonZeroU32

Source§

fn widen(self) -> u64

Source§

impl Widen<u64> for usize

Available on neither commonware_stability_DELTA nor commonware_stability_EPSILON nor commonware_stability_GAMMA nor commonware_stability_RESERVED.
Source§

fn widen(self) -> u64

Source§

impl Widen<u128> for NonZeroU8

Source§

fn widen(self) -> u128

Source§

impl Widen<u128> for NonZeroU16

Source§

fn widen(self) -> u128

Source§

impl Widen<u128> for NonZeroU32

Source§

fn widen(self) -> u128

Source§

impl Widen<u128> for NonZeroU64

Source§

fn widen(self) -> u128

Source§

impl Widen<usize> for NonZeroU8

Source§

fn widen(self) -> usize

Source§

impl Widen<usize> for NonZeroU16

Source§

fn widen(self) -> usize

Source§

impl Widen<usize> for u32

Available on neither commonware_stability_DELTA nor commonware_stability_EPSILON nor commonware_stability_GAMMA nor commonware_stability_RESERVED.
Source§

fn widen(self) -> usize

Implementors§