pub struct ComponentInvocationOptions {
pub args: Vec<String>,
pub env: Vec<(String, String)>,
pub working_dir: Option<PathBuf>,
pub expect_json_output: bool,
}Expand description
Options that tune how a component invocation is performed.
Fields§
§args: Vec<String>§env: Vec<(String, String)>§working_dir: Option<PathBuf>§expect_json_output: boolImplementations§
Source§impl ComponentInvocationOptions
impl ComponentInvocationOptions
Sourcepub fn add_arg(self, arg: impl Into<String>) -> Self
pub fn add_arg(self, arg: impl Into<String>) -> Self
Appends a pass-through argument for the component invocation.
Sourcepub fn add_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn add_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Adds an environment variable to the invocation context.
Sourcepub fn with_working_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn with_working_dir(self, dir: impl Into<PathBuf>) -> Self
Sets the working directory that will be used when spawning the component.
Sourcepub fn allow_non_json_output(self) -> Self
pub fn allow_non_json_output(self) -> Self
Turns off the JSON stdout assertion.
Source§impl ComponentInvocationOptions
impl ComponentInvocationOptions
pub fn invoke_generic_component( self, component_path: impl AsRef<Path>, op: &str, input_json: &str, ) -> Result<ComponentInvocation>
Trait Implementations§
Source§impl Clone for ComponentInvocationOptions
impl Clone for ComponentInvocationOptions
Source§fn clone(&self) -> ComponentInvocationOptions
fn clone(&self) -> ComponentInvocationOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComponentInvocationOptions
impl Debug for ComponentInvocationOptions
Auto Trait Implementations§
impl Freeze for ComponentInvocationOptions
impl RefUnwindSafe for ComponentInvocationOptions
impl Send for ComponentInvocationOptions
impl Sync for ComponentInvocationOptions
impl Unpin for ComponentInvocationOptions
impl UnwindSafe for ComponentInvocationOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more