BoolMappings

Trait BoolMappings 

Source
pub trait BoolMappings {
    // Required methods
    fn true_or<T>(&self, err: T) -> Result<(), T>;
    fn false_or<T>(&self, err: T) -> Result<(), T>;
}
Expand description

This extension trait adds additional methods to bools

Required Methods§

Source

fn true_or<T>(&self, err: T) -> Result<(), T>

Source

fn false_or<T>(&self, err: T) -> Result<(), T>

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 BoolMappings for bool

This is the impl of the extension trait

Source§

fn true_or<T>(&self, err: T) -> Result<(), T>

Convert a bool into a Result<(),T>

Source§

fn false_or<T>(&self, err: T) -> Result<(), T>

Convert a bool into a Result<(),T>

Implementors§