pub struct IncludeTree {
pub path: PathBuf,
pub source: String,
pub root: Option<SyntaxNode>,
pub includes: Vec<(PathBuf, IncludeTree)>,
}Expand description
One file in the include tree: path, source, parsed root, and parsed included files in order.
Fields§
§path: PathBufResolved path of this file (empty if from stdin / no path).
source: StringFull source of this file.
root: Option<SyntaxNode>Parsed AST (program root); None if parse failed or file is empty.
includes: Vec<(PathBuf, IncludeTree)>Resolved path and subtree for each include("...") in order.
Implementations§
Source§impl IncludeTree
impl IncludeTree
Sourcepub fn root_for_path(
&self,
main_path: &Path,
path: &Path,
) -> Option<&SyntaxNode>
pub fn root_for_path( &self, main_path: &Path, path: &Path, ) -> Option<&SyntaxNode>
Root AST for a path within this tree (main file or an included file).
Trait Implementations§
Source§impl Clone for IncludeTree
impl Clone for IncludeTree
Source§fn clone(&self) -> IncludeTree
fn clone(&self) -> IncludeTree
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 IncludeTree
impl RefUnwindSafe for IncludeTree
impl Send for IncludeTree
impl Sync for IncludeTree
impl Unpin for IncludeTree
impl UnsafeUnpin for IncludeTree
impl UnwindSafe for IncludeTree
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