Struct Builder

Source
pub struct Builder {
    pub rust_version: String,
    pub mode: BuildMode,
    pub bin: Option<String>,
    pub strip: bool,
    pub launcher: Launcher,
    pub code_root: PathBuf,
    pub project_path: PathBuf,
    pub packages: Vec<String>,
    pub relabel: Option<Relabel>,
}
Expand description

Options for running the build.

Fields§

§rust_version: String

Rust version to install. Can be anything rustup understands as a valid version, e.g. “stable” or “1.45.2”.

§mode: BuildMode

Whether to build for Amazon Linux 2 or AWS Lambda.

§bin: Option<String>

Name of the binary target to build. Can be None if the project only has one binary target.

§strip: bool

Strip the binary.

§launcher: Launcher

Container launcher.

§code_root: PathBuf

The root of the code that gets mounted in the container. All the source must live beneath this directory.

§project_path: PathBuf

The project path is the path of the crate to build. It must be somewhere within the code_root directory (or the same path).

§packages: Vec<String>

dev packages to install in container for build

§relabel: Option<Relabel>

Relabel files before bind-mounting (z or Z volume option). Warning: this overwrites the current label on files on the host. Doing this to a system directory like /usr could break your system.

Implementations§

Source§

impl Builder

Source

pub fn run(&self) -> Result<BuilderOutput, Error>

Run the build in a container.

This will produce either a standalone executable (for Amazon Linux 2) or a zip file (for AWS Lambda). The file is given a unique name for convenient uploading to S3, and a short symlink to the file is also created (target/latest-al2 or target/latest-lambda).

The paths of the files are returned.

Trait Implementations§

Source§

impl Clone for Builder

Source§

fn clone(&self) -> Builder

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Builder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Builder

Source§

fn eq(&self, other: &Builder) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Builder

Source§

impl StructuralPartialEq for Builder

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.