Trait readable::toa::Integer

source ·
pub trait Integer: Sealed { }
Expand description

An integer that can be written into an Itoa.

let itoa = Itoa::new(-2147483648_i64);
assert_eq!(itoa, "-2147483648");

// NonZero types work too.
let itoa = Itoa::new(std::num::NonZeroU32::new(1000).unwrap());
assert_eq!(itoa, "1000");

// ⚠️ Manual lossy conversion.
let itoa = Itoa::new(134.425 as u8);
assert_eq!(itoa, "134"); // decimal truncated

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Integer for i8

source§

impl Integer for i16

source§

impl Integer for i32

source§

impl Integer for i64

source§

impl Integer for i128

source§

impl Integer for isize

source§

impl Integer for u8

source§

impl Integer for u16

source§

impl Integer for u32

source§

impl Integer for u64

source§

impl Integer for u128

source§

impl Integer for usize

source§

impl Integer for NonZeroI8

source§

impl Integer for NonZeroI16

source§

impl Integer for NonZeroI32

source§

impl Integer for NonZeroI128

source§

impl Integer for NonZeroIsize

source§

impl Integer for NonZeroU8

source§

impl Integer for NonZeroU16

source§

impl Integer for NonZeroU32

source§

impl Integer for NonZeroU128

source§

impl Integer for NonZeroUsize

Implementors§