ProcessBuilder

Struct ProcessBuilder 

Source
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 IntoIterator<Item = impl Into<String>>, ) -> Self

Constructs a new ProcessBuilder with the following defaults:

  • No additional, user-overridable, arguments to the command
  • default is false
  • working_directory will be WorkingDirectory::App.
Source

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

Adds a user-overridable 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, user-overridable, arguments to the process.

To pass a single argument see arg.

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 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.