pub struct Program {
    pub exports: Vec<Export>,
    pub imports: Vec<Import>,
    pub enums: Vec<Enum>,
    pub structs: Vec<Struct>,
    pub consts: Vec<Const>,
    pub dictionaries: Vec<Dictionary>,
    pub typescript_custom_sections: Vec<String>,
}
Expand description

An abstract syntax tree representing a rust program. Contains extra information for joining up this rust code with javascript.

Fields

exports: Vec<Export>

rust -> js interfaces

imports: Vec<Import>

js -> rust interfaces

enums: Vec<Enum>

rust enums

structs: Vec<Struct>

rust structs

consts: Vec<Const>

rust consts

dictionaries: Vec<Dictionary>

“dictionaries”, generated for WebIDL, which are basically just “typed objects” in the sense that they represent a JS object with a particular shape in JIT parlance.

typescript_custom_sections: Vec<String>

custom typescript sections to be included in the definition file

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. 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

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.