Expand description
§neco-json5-ast
necosystems series structured access layer for JSON5 values.
§Features
- Owned
Json5DocumentwrappingJson5Valuefor cross-crate trait use - Borrowed
Json5Node<'a>carrying an optional field key parsere-export that turns&strintoJson5DocumentStructuredDocumentimpl exposing mapping fields as top-level nodesStructuredNodeimpl providingkind,identifier,attribute,children, andvalue
§Usage
use neco_ast::{StructuredDocument, StructuredNode};
let doc = neco_json5_ast::parse("name = neco\n").unwrap();
let node = doc.nodes().remove(0);
assert_eq!(node.kind(), "name");§API
| Item | Description |
|---|---|
parse(input: &str) -> Result<Json5Document, ParseError> | Parses input via neco-json5 and wraps the value |
Json5Document | Owned wrapper around Json5Value |
Json5Node<'a> | Borrowed view with an optional field key |
Json5Document::from_value / as_value | Constructs from or reads the inner Json5Value |
Json5Node::from_value / as_value | Constructs a root view or reads the inner Json5Value |
impl StructuredDocument for Json5Document | nodes() yields mapping fields, or the root value |
impl StructuredNode for Json5Node<'_> | Implements kind, identifier, attribute, children, and value |
§License
MIT