pub struct Setup { /* private fields */ }
Expand description

Setup acts as a builder for initializing a Neon build script

A default setup builder is provided as neon_build::setup().

Example

Output the neon module at lib/native.node

fn main() {
    neon_build::Setup::options()
        .output_dir("lib")
        .output_dir("native.node")
        .setup();
}

Implementations

Create a new builder for Setup options

Sets the output directory for the native library. Defaults to the cargo manifest directory. If not absolute, paths will be relative to the cargo manifest directory.

Sets the name of the native library. Defaults to index.node. If not absolute, paths will be relative to the Setup::output_dir.

Note: Node.js requires that native libraries have the .node extension to be loaded by require.

Setup the Cargo build process for Neon. Should be called once from fn main in a cargo build script.

Trait Implementations

Formats the value using the given formatter. 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 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.