Primitive Type bool
The boolean type
Trait Implementations
impl Rand 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);