pub trait Alteratorwhere
Self: Checker,{
// Provided methods
fn alterate(
node: &Node<'_>,
code: &[u8],
span: bool,
children: Vec<AstNode>,
) -> AstNode { ... }
fn get_text_span(
node: &Node<'_>,
code: &[u8],
span: bool,
text: bool,
) -> (String, Span) { ... }
fn get_default(
node: &Node<'_>,
code: &[u8],
span: bool,
children: Vec<AstNode>,
) -> AstNode { ... }
fn get_ast_node(
node: &Node<'_>,
code: &[u8],
children: Vec<AstNode>,
span: bool,
comment: bool,
) -> Option<AstNode> { ... }
}Expand description
A trait to create a richer AST node for a programming language, mainly
thought to be sent on the network.
Provided Methods§
Sourcefn alterate(
node: &Node<'_>,
code: &[u8],
span: bool,
children: Vec<AstNode>,
) -> AstNode
fn alterate( node: &Node<'_>, code: &[u8], span: bool, children: Vec<AstNode>, ) -> AstNode
Creates a new AST node containing the code associated to the node,
its span, and its children.
This function can be overloaded according to the needs of each programming language.
Sourcefn get_text_span(
node: &Node<'_>,
code: &[u8],
span: bool,
text: bool,
) -> (String, Span)
fn get_text_span( node: &Node<'_>, code: &[u8], span: bool, text: bool, ) -> (String, Span)
Gets the code as text and the span associated to a node.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".