pub struct HeapNode { /* private fields */ }
Expand description
HeapNode
contains a heap reference and a JSRef
to an AST subtree in it.
It implements SourceNode
for on-heap AST trees.
Implementations
Trait Implementations
sourceimpl SourceNode for HeapNode
impl SourceNode for HeapNode
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 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_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 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
fn map_opt_node<T, F>(&self, property: &str, action: F) -> ParseResult<Option<T>> where
F: FnMut(&Self) -> ParseResult<T>,
Auto Trait Implementations
impl RefUnwindSafe for HeapNode
impl !Send for HeapNode
impl !Sync for HeapNode
impl Unpin for HeapNode
impl UnwindSafe for HeapNode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more