Skip to main content

ToISize

Trait ToISize 

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

Trait defining instance method to_isize() : isize that provides a no-cost or low-cost conversion into isize.

It is expected that the implementing type “is-a” isize in a logical manner.

§Additional Implementations on Foreign Types

§Built-in Types

If the feature "implement-ToISize-for-built_ins" is defined (as it is by "default"), then this is also implemented for the following type(s):

  • isize;
  • i8;
  • i16 - if architecture is 16+ bits;
  • i32 - if architecture is 32+ bits;
  • i64 - if architecture is 64+ bits;
  • i128 - if architecture is 128+ bits;
  • u8 - if architecture is 16+ bits;
  • u16 - if architecture is 32+ bits;
  • u32 - if architecture is 64+ bits;
  • u64 - if architecture is 128+ bits;

Required Methods§

Source

fn to_isize(&self) -> isize

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ToISize for i8

Source§

fn to_isize(&self) -> isize

Source§

impl ToISize for i16

Source§

fn to_isize(&self) -> isize

Source§

impl ToISize for i32

Source§

fn to_isize(&self) -> isize

Source§

impl ToISize for i64

Source§

fn to_isize(&self) -> isize

Source§

impl ToISize for isize

Source§

fn to_isize(&self) -> isize

Source§

impl ToISize for u8

Source§

fn to_isize(&self) -> isize

Source§

impl ToISize for u16

Source§

fn to_isize(&self) -> isize

Source§

impl ToISize for u32

Source§

fn to_isize(&self) -> isize

Source§

impl<T: ToISize + ?Sized> ToISize for Box<T>

Available on non-crate feature nostd only.
Source§

fn to_isize(&self) -> isize

Source§

impl<T: ToISize + ?Sized> ToISize for Rc<T>

Available on non-crate feature nostd only.
Source§

fn to_isize(&self) -> isize

Implementors§