Expand description
§neco-json-ast
necosystems series structured access layer for JSON values.
§Features
- Owned
JsonDocumentwrappingJsonValuefor cross-crate trait use - Borrowed
JsonNode<'a>carrying an optional field key parsere-export that turns&[u8]intoJsonDocumentStructuredDocumentimpl exposing object fields as top-level nodesStructuredNodeimpl providingkind,identifier,attribute,children, andvalue
§Usage
use neco_ast::{StructuredDocument, StructuredNode};
let doc = neco_json_ast::parse(br#"{"name":"neco"}"#).unwrap();
let node = doc.nodes().remove(0);
assert_eq!(node.kind(), "name");§API
| Item | Description |
|---|---|
parse(input: &[u8]) -> Result<JsonDocument, ParseError> | Parses input via neco-json and wraps the value |
JsonDocument | Owned wrapper around JsonValue |
JsonNode<'a> | Borrowed view with an optional field key |
JsonDocument::from_value / as_value | Constructs from or reads the inner JsonValue |
JsonNode::from_value / as_value | Constructs a root view or reads the inner JsonValue |
impl StructuredDocument for JsonDocument | nodes() yields object fields, or the root value |
impl StructuredNode for JsonNode<'_> | Implements kind, identifier, attribute, children, and value |
§License
MIT