Expand description
zParse - High-performance JSON/TOML/YAML/XML parser
§Quick Start
use zparse::from_str;
let value = from_str(r#"{"name": "John", "age": 30}"#)?;
let name = value
.as_object()
.and_then(|obj| obj.get("name"))
.and_then(|v| v.as_string())
.unwrap_or_default();
assert_eq!(name, "John");Re-exports§
pub use error::Error;pub use error::ErrorKind;pub use error::Pos;pub use error::Result;pub use error::Span;pub use input::Input;pub use lexer::Token;pub use lexer::TokenKind;pub use value::Array;pub use value::Object;pub use value::TomlDatetime;pub use value::Value;pub use convert::ConvertOptions;pub use convert::Format;pub use convert::convert;pub use convert::convert_with_options;pub use json::Config;pub use json::Event;pub use json::Parser;pub use toml::Config as TomlConfig;pub use toml::Parser as TomlParser;pub use xml::Content as XmlContent;pub use xml::Document as XmlDocument;pub use xml::Element as XmlElement;pub use xml::Parser as XmlParser;pub use yaml::Config as YamlConfig;pub use yaml::Parser as YamlParser;pub use json::Config as JsonConfig;pub use json::Parser as JsonParser;pub use lexer::json::JsonLexer;pub use lexer::yaml::YamlLexer;
Modules§
- convert
- Format conversion utilities
- error
- Error types for zparse
- input
- Input abstraction for different sources
- json
- JSON streaming parser module
- lexer
- Lexer module for tokenization
- toml
- TOML streaming parser module
- value
- DOM types for parsed JSON/TOML/YAML/XML values
- xml
- XML parser module
- yaml
- YAML streaming parser module
Functions§
- detect_
format_ from_ path - Detect input format from a file path extension (case-insensitive).
- from_
bytes - Parse JSON from bytes
- from_
str - Parse JSON from string
- from_
str_ with_ config - Parse with custom configuration
- from_
toml_ bytes - Parse TOML from bytes
- from_
toml_ str - Parse TOML from string
- from_
toml_ str_ with_ config - Parse TOML with custom configuration
- from_
xml_ bytes - Parse XML from bytes
- from_
xml_ str - Parse XML from string
- from_
yaml_ bytes - Parse YAML from bytes
- from_
yaml_ str - Parse YAML from string
- from_
yaml_ str_ with_ config - Parse YAML with custom configuration