Primitive Type bool [-]  [+]

The boolean type

Trait Implementations

impl Not<bool> for bool

fn not(&self) -> bool

impl BitAnd<bool, bool> for bool

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

impl BitOr<bool, bool> for bool

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

impl BitXor<bool, bool> for bool

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

impl PartialEq for bool

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

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

impl Eq for bool

impl PartialOrd for bool

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

fn lt(&self, other: &Self) -> bool

fn le(&self, other: &Self) -> bool

fn gt(&self, other: &Self) -> bool

fn ge(&self, other: &Self) -> 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, source: &Self)

impl Default for bool

fn default() -> bool

impl FromStr for bool

fn from_str(s: &str) -> Option<bool>

Parse a bool from a string.

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

Examples

fn main() { assert_eq!(from_str::<bool>("true"), Some(true)); assert_eq!(from_str::<bool>("false"), Some(false)); assert_eq!(from_str::<bool>("not even a boolean"), None); }
assert_eq!(from_str::<bool>("true"), Some(true));
assert_eq!(from_str::<bool>("false"), Some(false));
assert_eq!(from_str::<bool>("not even a boolean"), None);

impl Show for bool

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