pub struct TreeNodeExt {
pub kind: SimpleNodeKindExt,
pub label: String,
pub children: Vec<TreeNodeExt>,
}Expand description
A generic tree node for testing AST operations.
Fields§
§kind: SimpleNodeKindExtKind of this node
label: StringLabel or identifier
children: Vec<TreeNodeExt>Children of this node
Implementations§
Source§impl TreeNodeExt
impl TreeNodeExt
Sourcepub fn app(func: TreeNodeExt, arg: TreeNodeExt) -> Self
pub fn app(func: TreeNodeExt, arg: TreeNodeExt) -> Self
Create an app node with two children.
Sourcepub fn lam(binder: &str, body: TreeNodeExt) -> Self
pub fn lam(binder: &str, body: TreeNodeExt) -> Self
Create a lam node.
Sourcepub fn visit<V: AstNodeVisitorExt>(&self, visitor: &mut V, depth: usize)
pub fn visit<V: AstNodeVisitorExt>(&self, visitor: &mut V, depth: usize)
Visit all nodes with a visitor.
Trait Implementations§
Source§impl Clone for TreeNodeExt
impl Clone for TreeNodeExt
Source§fn clone(&self) -> TreeNodeExt
fn clone(&self) -> TreeNodeExt
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TreeNodeExt
impl RefUnwindSafe for TreeNodeExt
impl Send for TreeNodeExt
impl Sync for TreeNodeExt
impl Unpin for TreeNodeExt
impl UnsafeUnpin for TreeNodeExt
impl UnwindSafe for TreeNodeExt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more