Struct libcnb_data::launch::ProcessBuilder
source · pub struct ProcessBuilder { /* private fields */ }Implementations§
source§impl ProcessBuilder
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();sourcepub fn new(type: ProcessType, command: impl Into<String>) -> Self
pub fn new(type: ProcessType, command: impl Into<String>) -> Self
Constructs a new ProcessBuilder with the following defaults:
- No arguments to the process
directisfalsedefaultisfalseworking_directorywill beWorkingDirectory::App.
sourcepub fn arg(&mut self, arg: impl Into<String>) -> &mut Self
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.
sourcepub fn args(
&mut self,
args: impl IntoIterator<Item = impl Into<String>>
) -> &mut Self
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.
sourcepub fn direct(&mut self, value: bool) -> &mut Self
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.
sourcepub fn default(&mut self, value: bool) -> &mut Self
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.
sourcepub fn working_directory(&mut self, value: WorkingDirectory) -> &mut Self
pub fn working_directory(&mut self, value: WorkingDirectory) -> &mut Self
Set the working directory for the process.