pub struct Program {
    pub exports: Vec<Export>,
    pub imports: Vec<Import>,
    pub enums: Vec<Enum>,
    pub structs: Vec<Struct>,
    pub typescript_custom_sections: Vec<String>,
    pub inline_js: 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

§typescript_custom_sections: Vec<String>

custom typescript sections to be included in the definition file

§inline_js: Vec<String>

Inline JS snippets

Implementations§

Returns true if the Program is empty

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
Attempt to convert a Self into tokens and add it to the TokenStream
Attempt to convert a Self into a new TokenStream

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.