Struct Ast
pub struct Ast { pub value: NodeValue, pub sourcepos: Sourcepos, /* private fields */ }
A single node in the CommonMark AST.
The struct contains metadata about the node's position in the original document, and the core
enum, NodeValue.
Fields
value: NodeValueThe node value itself.
sourcepos: SourceposThe positions in the source document this node comes from.
Implementations
impl Ast
fn new(value: NodeValue, start: LineColumn) -> SelfCreate a new AST node with the given value and starting sourcepos. The end column is set to zero; it is expected this will be set manually or later in the parse. Use
Ast::new_with_sourceposif you have full sourcepos.fn new_with_sourcepos(value: NodeValue, sourcepos: Sourcepos) -> SelfCreate a new AST node with the given value and sourcepos.
Trait Implementations
impl Clone for Ast
fn clone(&self) -> Self
impl Debug for Ast
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Ast
impl PartialEq for Ast
fn eq(&self, other: &Self) -> bool