Trait ToBool

Source
pub trait ToBool {
    // Required method
    fn to_bool(self) -> bool;
}

Required Methods§

Source

fn to_bool(self) -> bool

Implementations on Foreign Types§

Source§

impl ToBool for &'static str

Source§

fn to_bool(self) -> bool

Parse &str to bool (see more: str_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!"0".to_bool());
assert!("1".to_bool());
Source§

impl ToBool for f32

Source§

fn to_bool(self) -> bool

Parse f32 to bool (see more: f32_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0.0_f32.to_bool());
assert!(1.0_f32.to_bool());
Source§

impl ToBool for f64

Source§

fn to_bool(self) -> bool

Parse f64 to bool (see more: f64_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0.0_f64.to_bool());
assert!(1.0_f64.to_bool());
Source§

impl ToBool for i8

Source§

fn to_bool(self) -> bool

Parse i8 to bool (see more: i8_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0_i8.to_bool());
assert!(1_i8.to_bool());
Source§

impl ToBool for i16

Source§

fn to_bool(self) -> bool

Parse i16 to bool (see more: i16_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0_i16.to_bool());
assert!(1_i16.to_bool());
Source§

impl ToBool for i32

Source§

fn to_bool(self) -> bool

Parse i32 to bool (see more: i32_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0_i32.to_bool());
assert!(1_i32.to_bool());
Source§

impl ToBool for i64

Source§

fn to_bool(self) -> bool

Parse i64 to bool (see more: i64_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0_i64.to_bool());
assert!(1_i64.to_bool());
Source§

impl ToBool for isize

Source§

fn to_bool(self) -> bool

Parse isize to bool (see more: isize_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0_isize.to_bool());
assert!(1_isize.to_bool());
Source§

impl ToBool for u8

Source§

fn to_bool(self) -> bool

Parse u8 to bool (see more: u8_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0_u8.to_bool());
assert!(1_u8.to_bool());
Source§

impl ToBool for u16

Source§

fn to_bool(self) -> bool

Parse u16 to bool (see more: u16_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0_u16.to_bool());
assert!(1_u16.to_bool());
Source§

impl ToBool for u32

Source§

fn to_bool(self) -> bool

Parse u32 to bool (see more: u32_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0_u32.to_bool());
assert!(1_u32.to_bool());
Source§

impl ToBool for u64

Source§

fn to_bool(self) -> bool

Parse u64 to bool (see more: u64_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0_u64.to_bool());
assert!(1_u64.to_bool());
Source§

impl ToBool for usize

Source§

fn to_bool(self) -> bool

Parse usize to bool (see more: usize_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!0_usize.to_bool());
assert!(1_usize.to_bool());
Source§

impl ToBool for String

Source§

fn to_bool(self) -> bool

Parse String to bool (see more: string_to_bool)

§Examples
use rustils::parse::boolean::ToBool;

assert!(!String::from("0").to_bool());
assert!(String::from("1").to_bool());

Implementors§