Trait rv::data::Booleable

source ·
pub trait Booleable: Sized + Sync + Copy {
    // Required methods
    fn from_bool(b: bool) -> Self;
    fn try_into_bool(self) -> Option<bool>;

    // Provided method
    fn into_bool(self) -> bool { ... }
}
Expand description

Converts to and from a bool

Required Methods§

source

fn from_bool(b: bool) -> Self

Convert from bool. Should never panic.

source

fn try_into_bool(self) -> Option<bool>

Try to convert into bool. Returns None if cannot be converted.

Provided Methods§

source

fn into_bool(self) -> bool

Convert into bool Will panic if cannot be converted.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Booleable for bool

source§

impl Booleable for i8

source§

impl Booleable for i16

source§

impl Booleable for i32

source§

impl Booleable for i64

source§

impl Booleable for isize

source§

impl Booleable for u8

source§

impl Booleable for u16

source§

impl Booleable for u32

source§

impl Booleable for u64

source§

impl Booleable for usize

Implementors§