Skip to main content

ToIsize

Trait ToIsize 

Source
pub trait ToIsize {
    // Required method
    fn to_isize(self) -> isize;
}
Expand description

Infallibly convert a value into isize.

Implementations exist only when the conversion is guaranteed not to lose information under the selected min-usize-* portability contract.

use usize_conv::ToIsize;

let x: i16 = -3;
assert_eq!(x.to_isize(), -3isize);

Required Methods§

Source

fn to_isize(self) -> isize

Implementations on Foreign Types§

Source§

impl ToIsize for i8

Source§

impl ToIsize for i16

Source§

impl ToIsize for i32

Source§

impl ToIsize for i64

Source§

impl ToIsize for isize

Available on crate feature min-usize-32 only.
Source§

impl ToIsize for u8

Source§

impl ToIsize for u16

Source§

impl ToIsize for u32

Source§

impl ToIsize for NonZeroI8

Source§

impl ToIsize for NonZeroI16

Source§

impl ToIsize for NonZeroI32

Source§

impl ToIsize for NonZeroI64

Source§

impl ToIsize for NonZeroU8

Source§

impl ToIsize for NonZeroU16

Source§

impl ToIsize for NonZeroU32

Implementors§