[][src]Trait rustils::parse::int::ToI32

pub trait ToI32 {
    fn to_i32_res(self) -> ParseResultI32;
fn to_i32(self) -> i32; }

Required methods

fn to_i32_res(self) -> ParseResultI32

fn to_i32(self) -> i32

Loading content...

Implementations on Foreign Types

impl ToI32 for bool[src]

fn to_i32_res(self) -> ParseResultI32[src]

Parse bool to i32 (see more: bool_to_i32_res)

Examples

use rustils::parse::int::ToI32;

assert_eq!(true.to_i32_res(), Ok(1_i32));
assert_eq!(false.to_i32_res(), Ok(0_i32));

fn to_i32(self) -> i32[src]

Parse bool to i32 (see more: bool_to_i32)

Examples

use rustils::parse::int::ToI32;

assert_eq!(true.to_i32(), 1_i32);
assert_eq!(false.to_i32(), 0_i32);

impl ToI32 for u32[src]

fn to_i32_res(self) -> ParseResultI32[src]

Parse u32 to i32 (see more: u32_to_i32_res)

Examples

use rustils::parse::int::ToI32;

assert_eq!(0_u32.to_i32_res(), Ok(0_i32));
assert_eq!(2147483647_u32.to_i32_res(), Ok(2147483647_i32));

fn to_i32(self) -> i32[src]

Parse u32 to i32 (see more: u32_to_i32)

Examples

use rustils::parse::int::ToI32;

assert_eq!(0_u32.to_i32(), 0_i32);
assert_eq!(2147483647_u32.to_i32(), 2147483647_i32);

impl ToI32 for f32[src]

impl ToI32 for i64[src]

impl ToI32 for u64[src]

fn to_i32_res(self) -> ParseResultI32[src]

Parse u64 to i32 (see more: u64_to_i32_res)

Examples

use rustils::parse::int::ToI32;

assert_eq!(0_u64.to_i32_res(), Ok(0_i32));
assert_eq!(2147483647_u64.to_i32_res(), Ok(2147483647_i32));

fn to_i32(self) -> i32[src]

Parse u64 to i32 (see more: u64_to_i32)

Examples

use rustils::parse::int::ToI32;

assert_eq!(0_u64.to_i32(), 0_i32);
assert_eq!(2147483647_u64.to_i32(), 2147483647_i32);

impl ToI32 for f64[src]

impl ToI32 for isize[src]

impl ToI32 for usize[src]

fn to_i32_res(self) -> ParseResultI32[src]

Parse usize to i32 (see more: usize_to_i32_res)

Examples

use rustils::parse::int::ToI32;

assert_eq!(0_usize.to_i32_res(), Ok(0_i32));
assert_eq!(2147483647_usize.to_i32_res(), Ok(2147483647_i32));

fn to_i32(self) -> i32[src]

Parse usize to i32 (see more: usize_to_i32)

Examples

use rustils::parse::int::ToI32;

assert_eq!(0_usize.to_i32(), 0_i32);
assert_eq!(2147483647_usize.to_i32(), 2147483647_i32);

impl ToI32 for String[src]

impl ToI32 for &'static str[src]

Loading content...

Implementors

Loading content...