gml_parser

Function parse

source
pub fn parse(gml_str: &str) -> Result<Gml<'_>, String>
Expand description

Parse the graph string into a gml::Gml object. If the graph contains syntax errors, a human-readable error message will be returned.

let graph = r#"
graph [
  node [
    id 0
  ]
  edge [
    source 0
    target 0
  ]
]"#;
let graph = match gml_parser::parse(graph) {
    Ok(g) => g,
    Err(e) => panic!("Could not parse graph: {}", e),
};