Trait ToU8

Source
pub trait ToU8 {
    // Required methods
    fn to_u8_res(self) -> ParseResultU8;
    fn to_u8(self) -> u8;
}

Required Methods§

Implementations on Foreign Types§

Source§

impl ToU8 for &'static str

Source§

impl ToU8 for bool

Source§

fn to_u8_res(self) -> ParseResultU8

Parse bool to u8 (see more: bool_to_u8_res)

§Examples
use rustils::parse::ubyte::ToU8;

assert_eq!(true.to_u8_res(), Ok(1_u8));
assert_eq!(false.to_u8_res(), Ok(0_u8));
Source§

fn to_u8(self) -> u8

Parse bool to u8 (see more: bool_to_u8)

§Examples
use rustils::parse::ubyte::ToU8;

assert_eq!(true.to_u8(), 1_u8);
assert_eq!(false.to_u8(), 0_u8);
Source§

impl ToU8 for f32

Source§

impl ToU8 for f64

Source§

impl ToU8 for i8

Source§

impl ToU8 for i16

Source§

impl ToU8 for i32

Source§

impl ToU8 for i64

Source§

impl ToU8 for isize

Source§

impl ToU8 for u16

Source§

impl ToU8 for u32

Source§

impl ToU8 for u64

Source§

impl ToU8 for usize

Source§

impl ToU8 for String

Implementors§