Struct neon_build::Setup[][src]

pub struct Setup { /* fields omitted */ }

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

impl Setup[src]

pub fn options() -> Self[src]

Create a new builder for Setup options

pub fn output_dir(&mut self, output_dir: impl AsRef<Path>) -> &mut Self[src]

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.

pub fn output_file(&mut self, output_file: impl AsRef<Path>) -> &mut Self[src]

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.

pub fn setup(&self)[src]

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

Trait Implementations

impl Debug for Setup[src]

impl Default for Setup[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, U> Into<U> for T where
    U: From<T>, 
[src]

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.