Struct neon_build::Setup
source · [−]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
sourceimpl Setup
impl Setup
sourcepub fn output_dir(&mut self, output_dir: impl AsRef<Path>) -> &mut Self
pub fn output_dir(&mut self, output_dir: impl AsRef<Path>) -> &mut Self
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.
sourcepub fn output_file(&mut self, output_file: impl AsRef<Path>) -> &mut Self
pub fn output_file(&mut self, output_file: impl AsRef<Path>) -> &mut Self
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
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Setup
impl Send for Setup
impl Sync for Setup
impl Unpin for Setup
impl UnwindSafe for Setup
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more