Primitive Type bool
[-]
[+]
The boolean type
Trait Implementations
impl Rand for bool
impl Not<bool> for bool
impl BitAnd<bool, bool> for bool
impl BitOr<bool, bool> for bool
impl BitXor<bool, bool> for bool
impl PartialEq for bool
impl Eq for bool
fn assert_receiver_is_total_eq(&self)
impl PartialOrd 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
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);