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

source

pub fn new() -> Self

Create a new set of CompilerTables for use in compiling a flow

source

pub fn connection_to(&self, input: &Route) -> Option<Connection>

Return an optional connection found to a destination input

source

pub fn sort_functions(&mut self)

consistently order the functions so each compile produces the same numbering

source

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

Trait Implementations§

source§

impl Default for CompilerTables

source§

fn default() -> CompilerTables

Returns the “default value” for a type. Read more
source§

impl Serialize for CompilerTables

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<I, T> ExtractContext<I, ()> for T

§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<I> RecreateContext<I> for I

§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.