Struct neon_build::Setup [−][src]
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
Auto Trait Implementations
impl RefUnwindSafe for Setup
[src]
impl Send for Setup
[src]
impl Sync for Setup
[src]
impl Unpin for Setup
[src]
impl UnwindSafe for Setup
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,