Struct caribon::Ast [] [src]

#[repr(C)]
pub struct Ast { pub words: Vec<Word>, pub begin_head: Option<usize>, pub begin_body: Option<usize>, pub end_body: Option<usize>, }

The internal representation of the document.

Technically the name AST is not really well chosen, since it is not a tree, but mainly a vector of Words plus some additonal informations for HTML parsing, but the idea is that it is the internal representation of the documentation.

Fields

Vector of Words. The main data of the structure.

Position of tag, if any

position of

tag, if any

Methods

impl Ast
[src]

Creates a new, empty AST

Sets begin_head to current last position of words

This should be called before inserting the corresponding element.

Sets begin_body to current last position of words

This should be called before inserting the corresponding element.

Sets end_body to current last position of words

This should be called before inserting the corresponding element.

Get only the words contained between

and

If body_begin and body_end are both set (and the first one is before the second), returns a slice that contains only words in this part; else, returns all words.

Get only the words contained between

and
, mutable version

Same as get_body, but takes and return a mutable reference.

Trait Implementations

impl Debug for Ast
[src]

Formats the value using the given formatter.

impl Clone for Ast
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more