Struct leo_asg::program::InternalProgram[][src]

pub struct InternalProgram {
    pub id: Uuid,
    pub name: String,
    pub imported_modules: IndexMap<String, Program>,
    pub test_functions: IndexMap<String, (Arc<FunctionBody>, Option<Identifier>)>,
    pub functions: IndexMap<String, Arc<FunctionBody>>,
    pub circuits: IndexMap<String, Arc<CircuitBody>>,
    pub scope: Scope,
}

Stores the Leo program abstract semantic graph (ASG).

Fields

id: Uuid

The unique id of the program.

name: String

The program file name.

imported_modules: IndexMap<String, Program>

The packages imported by this program. these should generally not be accessed directly, but through scoped imports

test_functions: IndexMap<String, (Arc<FunctionBody>, Option<Identifier>)>

Maps test name => test code block.

functions: IndexMap<String, Arc<FunctionBody>>

Maps function name => function code block.

circuits: IndexMap<String, Arc<CircuitBody>>

Maps circuit name => circuit code block.

scope: Scope

Bindings for names and additional program context.

Implementations

impl InternalProgram[src]

pub fn new<T: ImportResolver + 'static>(
    program: &Program,
    import_resolver: &mut T
) -> Result<Program, AsgConvertError>
[src]

Returns a new Leo program ASG from the given Leo program AST and its imports.

Stages:

  1. resolve imports into super scope
  2. finalize declared types
  3. finalize declared functions
  4. resolve all asg nodes

Trait Implementations

impl Clone for InternalProgram[src]

impl Debug for InternalProgram[src]

impl Into<Program> for &InternalProgram[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.