Expand description
§JSnom
A small and ergonomic parser library for JSON.
All parsers provided silently discard any of the string remaining after parser finishes.
§Example
use jsnom::JsonValue;
assert_eq!(
JsonValue::from_str("[null, null, true]"),
Ok(JsonValue::Array(vec![
JsonValue::Null,
JsonValue::Null,
JsonValue::Bool(true)
]))
)
Structs§
- Error
- The error type returned from parsers. It is essentially a wrapper around
nom::error::VerboseError
using a differentstd::fmt::Display
.
Enums§
- Json
Value - Enum representing a parsed JSON input.
Functions§
- parse
- Parse a
JsonValue
from an input string. - parse_
array - Parse a
JsonValue::Array
from an input string. - parse_
bool - Parse a
JsonValue::Bool
from an input string. - parse_
null - Parse a
JsonValue::Null
from an input string. - parse_
number - Parse a
JsonValue::Number
from an input string. - parse_
object - Parse a
JsonValue::Object
from an input string. - parse_
string - Parse a
JsonValue::String
from an input string.