Struct Build

Source
pub struct Build { /* private fields */ }
Expand description

Represents the configuration for building Lua artifacts.

Implementations§

Source§

impl Build

Source

pub fn new() -> Build

Creates a new Build instance with default settings.

Source

pub fn out_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Build

Sets the output directory for the build artifacts.

This is required if called outside of a build script.

Source

pub fn target(&mut self, target: &str) -> &mut Build

Sets the target architecture for the build.

This is required if called outside of a build script.

Source

pub fn host(&mut self, host: &str) -> &mut Build

Sets the host architecture for the build.

This is optional and will default to the environment variable HOST if not set. If called outside of a build script, it will default to the target architecture.

Source

pub fn opt_level(&mut self, opt_level: &str) -> &mut Build

Sets the optimization level for the build.

This is optional and will default to the environment variable OPT_LEVEL if not set. If called outside of a build script, it will default to 0 in debug mode and 2 otherwise.

Source

pub fn debug(&mut self, debug: bool) -> &mut Build

Sets whether to build in debug mode.

This is optional and will default to the value of cfg!(debug_assertions). If set to true, it also enables Lua API checks.

Source

pub fn build(&self, version: Version) -> Artifacts

Builds the Lua artifacts for the specified version.

Source

pub fn try_build(&self, version: Version) -> Result<Artifacts, Box<dyn Error>>

Attempts to build the Lua artifacts for the specified version.

Returns an error if the build fails.

Trait Implementations§

Source§

impl Default for Build

Source§

fn default() -> Build

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Build

§

impl RefUnwindSafe for Build

§

impl Send for Build

§

impl Sync for Build

§

impl Unpin for Build

§

impl UnwindSafe for Build

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.