pub fn as_bool(&self) -> Option<bool> {
        match self.value.as_str() {
            "true" | "True" | "TRUE" => Some(true),
            "false" | "False" | "FALSE" => Some(false),
            _ => None,
        }
    }
/// Treat the scalar node as a boolean
///
/// If the scalar contains any of the following then it is true:
///
/// * `true`
/// * `True`
/// * `TRUE`
///
/// The following are considered false:
///
/// * `false`
/// * `False`
/// * `FALSE`
///
/// Everything else is not a boolean and so will return None
///
/// ```
/// # use marked_yaml::types::*;
/// let node: MarkedScalarNode = "true".into();
/// assert_eq!(node.as_bool(), Some(true));
/// let node: MarkedScalarNode = "FALSE".into();
/// assert_eq!(node.as_bool(), Some(false));
/// let node: MarkedScalarNode = "NO".into(); // YAML boolean, but not for us
/// assert_eq!(node.as_bool(), None);
/// ```
Treat the scalar node as a boolean
If the scalar contains any of the following then it is true.



The following are considered false.



Everything else is not a boolean and so will return None


Treat the scalar node as a boolean If the scalar contains any of the following then it is true . The following are considered false . Everything else is not a boolean and so will return None
pub fn as_bool(&self) -> Option<bool> {
        match self.value.as_str() {
            "true" | "True" | "TRUE" => Some(true),
            "false" | "False" | "FALSE" => Some(false),
            _ => None,
        }
    }
pub fn as_bool ( & self ) -> Option < bool > { match self . value . as_str ( ) { " " | " " | " " => Some ( true ) , " " | " " | " " => Some ( false ) , _ => None , } }
Treat the scalar node as a boolean
If the scalar contains any of the following then it is true:
Treat the scalar node as a boolean If the scalar contains any of the following then it is true :
&self
&self
use marked_yaml::types::*;
let node: MarkedScalarNode = "true".into();
assert_eq!(node.as_bool(), Some(true));
let node: MarkedScalarNode = "FALSE".into();
assert_eq!(node.as_bool(), Some(false));
let node: MarkedScalarNode = "NO".into(); // YAML boolean, but not for us
assert_eq!(node.as_bool(), None);
```
let node : MarkedScalarNode = " true " . into () ; assert_eq! ( node . as_bool () Some ( true )) ; let node : MarkedScalarNode = " FALSE " . into () ; assert_eq! ( node . as_bool () Some ( false )) ; let node : MarkedScalarNode = " NO " . into () ; // YAML boolean but not for us assert_eq! ( node . as_bool () None ) ; ` ` `