Primitive Type bool [-] [+]

The boolean type

Trait Implementations

impl Not for bool

type Output = bool

fn not(self) -> bool

impl<'a> Not for &'a bool

type Output = <bool as Not>::Output

fn not(self) -> <bool as Not>::Output

impl BitAnd<bool> for bool

type Output = bool

fn bitand(self, rhs: bool) -> bool

impl<'a> BitAnd<bool> for &'a bool

type Output = <bool as BitAnd<bool>>::Output

fn bitand(self, other: bool) -> <bool as BitAnd<bool>>::Output

impl<'a> BitAnd<&'a bool> for bool

type Output = <bool as BitAnd<bool>>::Output

fn bitand(self, other: &'a bool) -> <bool as BitAnd<bool>>::Output

impl<'a, 'b> BitAnd<&'a bool> for &'b bool

type Output = <bool as BitAnd<bool>>::Output

fn bitand(self, other: &'a bool) -> <bool as BitAnd<bool>>::Output

impl BitOr<bool> for bool

type Output = bool

fn bitor(self, rhs: bool) -> bool

impl<'a> BitOr<bool> for &'a bool

type Output = <bool as BitOr<bool>>::Output

fn bitor(self, other: bool) -> <bool as BitOr<bool>>::Output

impl<'a> BitOr<&'a bool> for bool

type Output = <bool as BitOr<bool>>::Output

fn bitor(self, other: &'a bool) -> <bool as BitOr<bool>>::Output

impl<'a, 'b> BitOr<&'a bool> for &'b bool

type Output = <bool as BitOr<bool>>::Output

fn bitor(self, other: &'a bool) -> <bool as BitOr<bool>>::Output

impl BitXor<bool> for bool

type Output = bool

fn bitxor(self, other: bool) -> bool

impl<'a> BitXor<bool> for &'a bool

type Output = <bool as BitXor<bool>>::Output

fn bitxor(self, other: bool) -> <bool as BitXor<bool>>::Output

impl<'a> BitXor<&'a bool> for bool

type Output = <bool as BitXor<bool>>::Output

fn bitxor(self, other: &'a bool) -> <bool as BitXor<bool>>::Output

impl<'a, 'b> BitXor<&'a bool> for &'b bool

type Output = <bool as BitXor<bool>>::Output

fn bitxor(self, other: &'a bool) -> <bool as BitXor<bool>>::Output

impl PartialEq<bool> for bool

fn eq(&self, other: &bool) -> bool

fn ne(&self, other: &bool) -> bool

fn ne(&self, &bool) -> bool

impl Eq for bool

fn assert_receiver_is_total_eq(&self)

impl PartialOrd<bool> for bool

fn partial_cmp(&self, other: &bool) -> Option<Ordering>

fn lt(&self, &bool) -> bool

fn le(&self, &bool) -> bool

fn gt(&self, &bool) -> bool

fn ge(&self, &bool) -> bool

impl Ord for bool

fn cmp(&self, other: &bool) -> Ordering

impl Clone for bool

fn clone(&self) -> bool

Return a deep copy of the value.

fn clone_from(&mut self, &bool)

impl Default for bool

fn default() -> bool

impl FromStr for bool

type Err = ParseBoolError

fn from_str(s: &str) -> Result<bool, ParseBoolError>

Parse a bool from a string.

Yields an Option<bool>, because s may or may not actually be parseable.

Examples

fn main() { assert_eq!("true".parse(), Ok(true)); assert_eq!("false".parse(), Ok(false)); assert!("not even a boolean".parse::<bool>().is_err()); }
assert_eq!("true".parse(), Ok(true));
assert_eq!("false".parse(), Ok(false));
assert!("not even a boolean".parse::<bool>().is_err());

impl Hash for bool

fn hash<H>(&self, state: &mut H) where H: Hasher

fn hash_slice<H>(&[bool], &mut H) where H: Hasher, bool: Sized

impl Debug for bool

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

impl Display for bool

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

impl Rand for bool

fn rand<R>(rng: &mut R) -> bool where R: Rng