Home
runx-parser

runx_parser::yaml

Functions §

parse_yaml_document §

fn parse_yaml_document(source: &str) -> Result<T, crate::ParseError>

assert_yaml_parity_subset §

fn assert_yaml_parity_subset(field: &str, source: &str) -> Result<(), crate::ParseError>

yaml_scalar_subset_allows §

fn yaml_scalar_subset_allows(literal: &str) -> bool
#[must_use]

false for scalars YAML would coerce to a non-string (booleans, numbers, dates, special floats), so callers know to keep them quoted.

Examples

use runx_parser::yaml::yaml_scalar_subset_allows;

assert!(yaml_scalar_subset_allows("echo")); // plain string: safe
assert!(!yaml_scalar_subset_allows("yes")); // YAML boolean: ambiguous
use runx_parser::yaml::yaml_scalar_subset_allows;

assert!(yaml_scalar_subset_allows("echo")); // plain string: safe
assert!(!yaml_scalar_subset_allows("yes")); // YAML boolean: ambiguous

assert_yaml_scalar_subset §

fn assert_yaml_scalar_subset(field: &str, literal: &str) -> Result<(), crate::ParseError>