Struct flowrclib::compiler::compile::CompilerTables
source · pub struct CompilerTables {
pub connections: Vec<Connection>,
pub sources: BTreeMap<Route, (Source, usize)>,
pub destination_routes: BTreeMap<Route, (usize, usize, usize)>,
pub collapsed_connections: Vec<Connection>,
pub functions: Vec<FunctionDefinition>,
pub libs: BTreeSet<Url>,
pub context_functions: BTreeSet<Url>,
pub source_files: Vec<String>,
}
Expand description
CompilerTables are built from the flattened and connected flow model in memory and are used to generate the flow’s manifest ready to be executed.
Fields§
§connections: Vec<Connection>
The set of connections between functions in the compiled flow
sources: BTreeMap<Route, (Source, usize)>
Map of sources of values and what route they are connected to
destination_routes: BTreeMap<Route, (usize, usize, usize)>
Map from “route of the output of a function” –> (output name, source_function_id)
collapsed_connections: Vec<Connection>
HashMap from “route of the input of a function” –> (destination_function_id, input number, flow_id)
functions: Vec<FunctionDefinition>
The set of functions left in a flow after it has been flattened, connected and optimized
libs: BTreeSet<Url>
The set of libraries used by a flow, from their Urls
context_functions: BTreeSet<Url>
The set of context functions used by a flow, from their Urls
source_files: Vec<String>
The list of source files that were used in the flow definition
Implementations§
source§impl CompilerTables
impl CompilerTables
sourcepub fn connection_to(&self, input: &Route) -> Option<Connection>
pub fn connection_to(&self, input: &Route) -> Option<Connection>
Return an optional connection found to a destination input
sourcepub fn sort_functions(&mut self)
pub fn sort_functions(&mut self)
consistently order the functions so each compile produces the same numbering
sourcepub fn create_routes_table(&mut self)
pub fn create_routes_table(&mut self)
Construct two look-up tables that can be used to find the index of a function in the functions table, and the index of it’s input - using the input route or it’s output route