UsizeTag

Trait UsizeTag 

Source
pub trait UsizeTag: Sized {
    // Required methods
    fn from_usize(n: usize) -> Self;
    fn to_usize(&self) -> usize;
    fn try_to_usize(&self) -> Option<usize>;
}

Required Methods§

Source

fn from_usize(n: usize) -> Self

Source

fn to_usize(&self) -> usize

Source

fn try_to_usize(&self) -> Option<usize>

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 UsizeTag for bool

Source§

impl UsizeTag for i8

Source§

impl UsizeTag for i16

Source§

impl UsizeTag for i32

Source§

impl UsizeTag for i64

Source§

impl UsizeTag for i128

Source§

impl UsizeTag for u8

Source§

impl UsizeTag for u16

Source§

impl UsizeTag for u32

Source§

impl UsizeTag for u64

Source§

impl UsizeTag for u128

Source§

impl UsizeTag for NonZero<i8>

Source§

impl UsizeTag for NonZero<i16>

Source§

impl UsizeTag for NonZero<i32>

Source§

impl UsizeTag for NonZero<i64>

Source§

impl UsizeTag for NonZero<i128>

Source§

impl UsizeTag for NonZero<u8>

Source§

impl UsizeTag for NonZero<u16>

Source§

impl UsizeTag for NonZero<u32>

Source§

impl UsizeTag for NonZero<u64>

Source§

impl UsizeTag for NonZero<u128>

Implementors§

Source§

impl<T: UsizeTag, const MAX: usize> UsizeTag for EnumTag<T, MAX>