Trait ToU32

Source
pub trait ToU32 {
    // Required methods
    fn to_u32_res(self) -> ParseResultU32;
    fn to_u32(self) -> u32;
}

Required Methods§

Implementations on Foreign Types§

Source§

impl ToU32 for &'static str

Source§

impl ToU32 for bool

Source§

fn to_u32_res(self) -> ParseResultU32

Parse bool to u32 (see more: bool_to_u32_res)

§Examples
use rustils::parse::uint::ToU32;

assert_eq!(true.to_u32_res(), Ok(1_u32));
assert_eq!(false.to_u32_res(), Ok(0_u32));
Source§

fn to_u32(self) -> u32

Parse bool to u32 (see more: bool_to_u32)

§Examples
use rustils::parse::uint::ToU32;

assert_eq!(true.to_u32(), 1_u32);
assert_eq!(false.to_u32(), 0_u32);
Source§

impl ToU32 for f32

Source§

impl ToU32 for f64

Source§

impl ToU32 for i8

Source§

impl ToU32 for i16

Source§

impl ToU32 for i32

Source§

impl ToU32 for i64

Source§

impl ToU32 for isize

Source§

impl ToU32 for u64

Source§

impl ToU32 for usize

Source§

impl ToU32 for String

Implementors§