Struct yaml_rust2::yaml::YamlLoader
source · pub struct YamlLoader { /* private fields */ }
Expand description
Main structure for quickly parsing YAML.
Implementations§
source§impl YamlLoader
impl YamlLoader
sourcepub fn load_from_str(source: &str) -> Result<Vec<Yaml>, ScanError>
pub fn load_from_str(source: &str) -> Result<Vec<Yaml>, ScanError>
Load the given string as a set of YAML documents.
The source
is interpreted as YAML documents and is parsed. Parsing succeeds if and only
if all documents are parsed successfully. An error in a latter document prevents the former
from being returned.
§Errors
Returns ScanError
when loading fails.
sourcepub fn load_from_iter<I: Iterator<Item = char>>(
source: I
) -> Result<Vec<Yaml>, ScanError>
pub fn load_from_iter<I: Iterator<Item = char>>( source: I ) -> Result<Vec<Yaml>, ScanError>
Load the contents of the given iterator as a set of YAML documents.
The source
is interpreted as YAML documents and is parsed. Parsing succeeds if and only
if all documents are parsed successfully. An error in a latter document prevents the former
from being returned.
§Errors
Returns ScanError
when loading fails.
sourcepub fn load_from_parser<I: Iterator<Item = char>>(
parser: &mut Parser<I>
) -> Result<Vec<Yaml>, ScanError>
pub fn load_from_parser<I: Iterator<Item = char>>( parser: &mut Parser<I> ) -> Result<Vec<Yaml>, ScanError>
Load the contents from the specified Parser as a set of YAML documents.
Parsing succeeds if and only if all documents are parsed successfully. An error in a latter document prevents the former from being returned.
§Errors
Returns ScanError
when loading fails.