Struct tree_sitter_graph::ast::File
source · [−]Expand description
A graph DSL file
Fields
language: Language
query: Option<Query>
The combined query of all stanzas in the file
stanzas: Vec<Stanza>
The list of stanzas in the file
Implementations
sourceimpl File
impl File
sourcepub fn execute<'tree>(
&self,
tree: &'tree Tree,
source: &'tree str,
functions: &mut Functions,
globals: &Globals<'_>
) -> Result<Graph<'tree>, ExecutionError>
pub fn execute<'tree>(
&self,
tree: &'tree Tree,
source: &'tree str,
functions: &mut Functions,
globals: &Globals<'_>
) -> Result<Graph<'tree>, ExecutionError>
Executes this graph DSL file against a source file. You must provide the parsed syntax
tree (tree
) as well as the source text that it was parsed from (source
). You also
provide the set of functions and global variables that are available during execution.
sourcepub fn execute_into<'tree>(
&self,
graph: &mut Graph<'tree>,
tree: &'tree Tree,
source: &'tree str,
functions: &mut Functions,
globals: &Globals<'_>
) -> Result<(), ExecutionError>
pub fn execute_into<'tree>(
&self,
graph: &mut Graph<'tree>,
tree: &'tree Tree,
source: &'tree str,
functions: &mut Functions,
globals: &Globals<'_>
) -> Result<(), ExecutionError>
Executes this graph DSL file against a source file, saving the results into an existing
Graph
instance. You must provide the parsed syntax tree (tree
) as well as the source
text that it was parsed from (source
). You also provide the set of functions and global
variables that are available during execution. This variant is useful when you need to
“pre-seed” the graph with some predefined nodes and/or edges before executing the DSL file.
sourceimpl File
impl File
sourcepub fn execute_lazy<'tree>(
&self,
tree: &'tree Tree,
source: &'tree str,
functions: &mut Functions,
globals: &Globals<'_>
) -> Result<Graph<'tree>, ExecutionError>
pub fn execute_lazy<'tree>(
&self,
tree: &'tree Tree,
source: &'tree str,
functions: &mut Functions,
globals: &Globals<'_>
) -> Result<Graph<'tree>, ExecutionError>
Executes this graph DSL file against a source file. You must provide the parsed syntax
tree (tree
) as well as the source text that it was parsed from (source
). You also
provide the set of functions and global variables that are available during execution.
sourcepub fn execute_lazy_into<'tree>(
&self,
graph: &mut Graph<'tree>,
tree: &'tree Tree,
source: &'tree str,
functions: &mut Functions,
globals: &Globals<'_>
) -> Result<(), ExecutionError>
pub fn execute_lazy_into<'tree>(
&self,
graph: &mut Graph<'tree>,
tree: &'tree Tree,
source: &'tree str,
functions: &mut Functions,
globals: &Globals<'_>
) -> Result<(), ExecutionError>
Executes this graph DSL file against a source file, saving the results into an existing
Graph
instance. You must provide the parsed syntax tree (tree
) as well as the source
text that it was parsed from (source
). You also provide the set of functions and global
variables that are available during execution. This variant is useful when you need to
“pre-seed” the graph with some predefined nodes and/or edges before executing the DSL file.
sourceimpl File
impl File
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for File
impl !Send for File
impl !Sync for File
impl Unpin for File
impl UnwindSafe for File
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more