pub struct ProcessBuilder { /* private fields */ }

Implementations§

source§

impl ProcessBuilder

A non-consuming builder for Process values.

Examples

ProcessBuilder::new(process_type!("web"), "java")
    .arg("-jar")
    .arg("target/application-1.0.0.jar")
    .default(true)
    .build();
source

pub fn new(type: ProcessType, command: impl Into<String>) -> Self

Constructs a new ProcessBuilder with the following defaults:

  • No arguments to the process
  • direct is false
  • default is false
  • working_directory will be WorkingDirectory::App.
source

pub fn arg(&mut self, arg: impl Into<String>) -> &mut Self

Adds an argument to the process.

Only one argument can be passed per use. So instead of:

.arg("-C /path/to/repo")

usage would be:

.arg("-C")
.arg("/path/to/repo")

To pass multiple arguments see args.

source

pub fn args(
&mut self,
args: impl IntoIterator<Item = impl Into<String>>
) -> &mut Self

Adds multiple arguments to pass to the process.

To pass a single argument see arg.

source

pub fn direct(&mut self, value: bool) -> &mut Self

Sets the direct flag on the process.

If this is true, the lifecycle will launch the command directly, rather than via a shell.

source

pub fn default(&mut self, value: bool) -> &mut Self

Sets the default flag on the process.

Indicates that the process type should be selected as the buildpack-provided default during the export phase.

source

pub fn working_directory(&mut self, value: WorkingDirectory) -> &mut Self

Set the working directory for the process.

source

pub fn build(&self) -> Process

Builds the Process based on the configuration of this builder.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.