pub enum Decl<'a, 'f> {
    Const {
        name: Ident<'a, 'f>,
        value: Option<Spanned<'f, Expr<'a, 'f>>>,
        ty: Option<TyExpr<'a, 'f>>,
    },
    Ty {
        name: Spanned<'f, Ident<'a, 'f>>,
        value: Spanned<'f, TyDecl<'a, 'f>>,
    },
    ExternalNode {
        is_unsafe: bool,
        is_function: bool,
        name: Spanned<'f, Ident<'a, 'f>>,
        static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>,
        params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
        outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
    },
    Node {
        is_unsafe: bool,
        is_function: bool,
        name: Spanned<'f, Ident<'a, 'f>>,
        static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>,
        params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
        outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
        vars: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
        consts: Vec<Spanned<'f, Decl<'a, 'f>>>,
        body: Vec<Spanned<'f, BodyItem<'a, 'f>>>,
    },
    AliasNode {
        is_unsafe: bool,
        is_function: bool,
        name: Spanned<'f, Ident<'a, 'f>>,
        static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>,
        params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
        outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>,
        effective_node: Spanned<'f, (Spanned<'f, Ident<'a, 'f>>, Vec<StaticArg<'a, 'f>>)>,
    },
    Model {
        name: Spanned<'f, Ident<'a, 'f>>,
        uses: Vec<Spanned<'f, Ident<'a, 'f>>>,
        needs: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>,
        provides: Vec<Spanned<'f, AbstractDecl<'a, 'f>>>,
        body: Vec<Spanned<'f, Decl<'a, 'f>>>,
    },
    PackageAlias {
        name: Spanned<'f, Ident<'a, 'f>>,
        model: Spanned<'f, Ident<'a, 'f>>,
        static_params: Vec<(Spanned<'f, Ident<'a, 'f>>, StaticArg<'a, 'f>)>,
    },
    Package {
        name: Spanned<'f, Ident<'a, 'f>>,
        uses: Vec<Spanned<'f, Ident<'a, 'f>>>,
        provides: Vec<Spanned<'f, AbstractDecl<'a, 'f>>>,
        body: Vec<Spanned<'f, Decl<'a, 'f>>>,
    },
}
Expand description

A single declaration

Variants

Const

Fields

name: Ident<'a, 'f>

Name of the constant

value: Option<Spanned<'f, Expr<'a, 'f>>>

The value of the constant.

May be None for external constants

ty: Option<TyExpr<'a, 'f>>

The type of the constant, if specified.

Constant declaration

Ty

Fields

name: Spanned<'f, Ident<'a, 'f>>

Name of the type

value: Spanned<'f, TyDecl<'a, 'f>>

Value of the type

Type declaration

ExternalNode

Fields

is_unsafe: bool

Is it unsafe

is_function: bool

Is it a functional node

name: Spanned<'f, Ident<'a, 'f>>

Its name

static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>

The static parameters it takes

params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>

The dynamic parameters it takes

outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>

Its outputs

An external node.

Node

Fields

is_unsafe: bool

Is it unsafe

is_function: bool

Is it a functional node

name: Spanned<'f, Ident<'a, 'f>>

Its name

static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>

The static parameters it takes

params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>

The dynamic parameters it takes

outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>

Its outputs

vars: Vec<Spanned<'f, VariableDecl<'a, 'f>>>

The local variables of this node

consts: Vec<Spanned<'f, Decl<'a, 'f>>>

The local constants of this node

body: Vec<Spanned<'f, BodyItem<'a, 'f>>>

The body of the node.

It is a list of assertions and equations.

A local node

AliasNode

Fields

is_unsafe: bool

Is it unsafe

is_function: bool

Is it a functional node

name: Spanned<'f, Ident<'a, 'f>>

Its name

static_params: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>

The static parameters it takes

params: Vec<Spanned<'f, VariableDecl<'a, 'f>>>

The dynamic parameters it takes

outputs: Vec<Spanned<'f, VariableDecl<'a, 'f>>>

Its outputs

effective_node: Spanned<'f, (Spanned<'f, Ident<'a, 'f>>, Vec<StaticArg<'a, 'f>>)>

The value of the aliasing

An alias node

Model

Fields

name: Spanned<'f, Ident<'a, 'f>>

Its name

uses: Vec<Spanned<'f, Ident<'a, 'f>>>

What packages this model uses

needs: Vec<Spanned<'f, StaticParamDecl<'a, 'f>>>

What functions/nodes/types/constants this model needs

provides: Vec<Spanned<'f, AbstractDecl<'a, 'f>>>

What functions/nodes/types/constants this model should provides

body: Vec<Spanned<'f, Decl<'a, 'f>>>

The body of the model

A package model

PackageAlias

Fields

name: Spanned<'f, Ident<'a, 'f>>

Its name

model: Spanned<'f, Ident<'a, 'f>>

The model this package is based on

static_params: Vec<(Spanned<'f, Ident<'a, 'f>>, StaticArg<'a, 'f>)>

The parameters of the model

A package alias

Package

Fields

name: Spanned<'f, Ident<'a, 'f>>

Its name

uses: Vec<Spanned<'f, Ident<'a, 'f>>>

What packages it uses

provides: Vec<Spanned<'f, AbstractDecl<'a, 'f>>>

What definitions it provides

body: Vec<Spanned<'f, Decl<'a, 'f>>>

Its body, which is a collection of declarations

A package definition

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.