pub trait FromUsize: Sized {
    // Required method
    fn from_usize(n: usize) -> Option<Self>;
}
Expand description

Specifies how to obtain an instance of this numeric type equal to the usize primitive. If the number is too large to represent in this type, None should be returned instead.

The boilerplate implementations for primitives is performed with a macro. If a primitive type is missing from this list, please open an issue to add it in.

Required Methods§

source

fn from_usize(n: usize) -> Option<Self>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromUsize for f32

source§

impl FromUsize for f64

source§

impl FromUsize for i8

source§

impl FromUsize for i16

source§

impl FromUsize for i32

source§

impl FromUsize for i64

source§

impl FromUsize for i128

source§

impl FromUsize for isize

source§

impl FromUsize for u8

source§

impl FromUsize for u16

source§

impl FromUsize for u32

source§

impl FromUsize for u64

source§

impl FromUsize for u128

source§

impl FromUsize for usize

source§

impl<T: FromUsize> FromUsize for Saturating<T>

source§

impl<T: FromUsize> FromUsize for Wrapping<T>

Implementors§