pub type JSON = Value;
Trait Implementations
sourceimpl SourceNode for JSON
impl SourceNode for JSON
sourcefn get_location(&self) -> Option<Location>
fn get_location(&self) -> Option<Location>
Try to get source mapping for self
.
sourcefn get_literal(&self, property: &str) -> ParseResult<Literal>
fn get_literal(&self, property: &str) -> ParseResult<Literal>
Use the node as a literal.
sourcefn map_node<T, F>(&self, property: &str, action: F) -> ParseResult<T> where
F: FnMut(&Self) -> ParseResult<T>,
fn map_node<T, F>(&self, property: &str, action: F) -> ParseResult<T> where
F: FnMut(&Self) -> ParseResult<T>,
Get a child node with this name; if it does not exist, return None.
Then transform it through action
, propagating its Result out.
A child node exis Read more
sourcefn get_bool(&self, property: &str) -> ParseResult<bool>
fn get_bool(&self, property: &str) -> ParseResult<bool>
Get the boolean value of a child node with name property
.
It’s a ParseError if it does not exist or does not have a boolean meaning. Read more
sourcefn get_str(&self, property: &str) -> ParseResult<JSString>
fn get_str(&self, property: &str) -> ParseResult<JSString>
Get the string value of a child node with name property
.
It’s a ParseError if it does not exist or does not have a string meaning. Read more
sourcefn map_array<T, F>(&self, property: &str, func: F) -> ParseResult<Vec<T>> where
F: FnMut(&Self) -> ParseResult<T>,
fn map_array<T, F>(&self, property: &str, func: F) -> ParseResult<Vec<T>> where
F: FnMut(&Self) -> ParseResult<T>,
Map the array of children of a child node with name property
.
It’s a ParseError if it does not exist or does not have an array meaning. Read more
sourcefn expect_str(&self, property: &str, value: &'static str) -> ParseResult<()>
fn expect_str(&self, property: &str, value: &'static str) -> ParseResult<()>
Check that the value of property
is a string equal to value
.
Depends on SourceNode::get_str
. Read more