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]
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
Auto Trait Implementations
impl RefUnwindSafe for Setup
impl RefUnwindSafe for Setup
impl UnwindSafe for Setup
impl UnwindSafe for Setup