Struct tree_sitter_graph::ast::File  
source · [−]pub struct File {
    pub language: Language,
    pub globals: Vec<Global>,
    pub query: Option<Query>,
    pub stanzas: Vec<Stanza>,
    pub shorthands: AttributeShorthands,
}Expand description
A graph DSL file
Fields
language: Languageglobals: Vec<Global>The expected global variables used in this file
query: Option<Query>The combined query of all stanzas in the file
stanzas: Vec<Stanza>The list of stanzas in the file
shorthands: AttributeShorthandsAttribute shorthands defined in the file
Implementations
sourceimpl File
 
impl File
sourcepub fn execute<'tree>(
    &self,
    tree: &'tree Tree,
    source: &'tree str,
    config: &mut ExecutionConfig<'_, '_>,
    cancellation_flag: &dyn CancellationFlag
) -> Result<Graph<'tree>, ExecutionError>
 
pub fn execute<'tree>(
    &self,
    tree: &'tree Tree,
    source: &'tree str,
    config: &mut ExecutionConfig<'_, '_>,
    cancellation_flag: &dyn CancellationFlag
) -> 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,
    config: &mut ExecutionConfig<'_, '_>,
    cancellation_flag: &dyn CancellationFlag
) -> Result<(), ExecutionError>
 
pub fn execute_into<'tree>(
    &self,
    graph: &mut Graph<'tree>,
    tree: &'tree Tree,
    source: &'tree str,
    config: &mut ExecutionConfig<'_, '_>,
    cancellation_flag: &dyn CancellationFlag
) -> 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.
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 · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more