wiwi::num

Trait FromBool

Source
pub trait FromBool
where Self: Sealed,
{ // Required method fn from_bool(value: bool) -> Self; }
Expand description

Trait for number types that can be converted from bool, losslessly

Required Methods§

Source

fn from_bool(value: bool) -> Self

Convert from a bool value

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromBool for f32

Source§

fn from_bool(value: bool) -> f32

Source§

impl FromBool for f64

Source§

fn from_bool(value: bool) -> f64

Source§

impl FromBool for i8

Source§

fn from_bool(value: bool) -> i8

Source§

impl FromBool for i16

Source§

fn from_bool(value: bool) -> i16

Source§

impl FromBool for i32

Source§

fn from_bool(value: bool) -> i32

Source§

impl FromBool for i64

Source§

fn from_bool(value: bool) -> i64

Source§

impl FromBool for i128

Source§

impl FromBool for isize

Source§

impl FromBool for u8

Source§

fn from_bool(value: bool) -> u8

Source§

impl FromBool for u16

Source§

fn from_bool(value: bool) -> u16

Source§

impl FromBool for u32

Source§

fn from_bool(value: bool) -> u32

Source§

impl FromBool for u64

Source§

fn from_bool(value: bool) -> u64

Source§

impl FromBool for u128

Source§

impl FromBool for usize

Implementors§