Primitive Type bool
[-] [+]
The boolean type
Trait Implementations
impl Not for bool
impl<'a> Not for &'a bool
impl BitAnd<bool> for 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
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
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
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
impl Clone for bool
impl Default for 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());