Skip to main content

Crate neco_yml_ast

Crate neco_yml_ast 

Source
Expand description

§neco-yml-ast

日本語

necosystems series structured access layer for YAML values.

§Features

  • Owned YmlDocument wrapping YmlValue for cross-crate trait use
  • Borrowed YmlNode<'a> carrying an optional field key
  • parse re-export that turns &str into YmlDocument
  • StructuredDocument impl exposing mapping fields as top-level nodes
  • StructuredNode impl providing kind, identifier, attribute, children, and value

§Usage

use neco_ast::{StructuredDocument, StructuredNode};

let doc = neco_yml_ast::parse("name = neco\n").unwrap();
let node = doc.nodes().remove(0);
assert_eq!(node.kind(), "name");

§API

ItemDescription
parse(input: &str) -> Result<YmlDocument, ParseError>Parses input via neco-yml and wraps the value
YmlDocumentOwned wrapper around YmlValue
YmlNode<'a>Borrowed view with an optional field key
YmlDocument::from_value / as_valueConstructs from or reads the inner YmlValue
YmlNode::from_value / as_valueConstructs a root view or reads the inner YmlValue
impl StructuredDocument for YmlDocumentnodes() yields mapping fields, or the root value
impl StructuredNode for YmlNode<'_>Implements kind, identifier, attribute, children, and value

§License

MIT

Structs§

YmlDocument
YmlNode

Functions§

parse