Skip to main content

ExecBuilder

Struct ExecBuilder 

Source
pub struct ExecBuilder<'a, S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<'a, S: State> ExecBuilder<'a, S>

Source

pub fn build(self) -> Exec<'a>
where S: IsComplete,

Finishes building and performs the requested action.

Source

pub fn exe(self, value: &'a str) -> ExecBuilder<'a, SetExe<S>>
where S::Exe: IsUnset,

Required.

Source

pub fn args(self, value: Vec<&'a str>) -> ExecBuilder<'a, SetArgs<S>>
where S::Args: IsUnset,

Optional (Some / Option setters). Default: <Vec<&'a str> as Default>::default().

Source

pub fn maybe_args( self, value: Option<Vec<&'a str>>, ) -> ExecBuilder<'a, SetArgs<S>>
where S::Args: IsUnset,

Optional (Some / Option setters). Default: <Vec<&'a str> as Default>::default().

Source

pub fn num_paths(self, value: usize) -> ExecBuilder<'a, SetNumPaths<S>>
where S::NumPaths: IsUnset,

Optional (Some / Option setters). Default: 0.

Source

pub fn maybe_num_paths( self, value: Option<usize>, ) -> ExecBuilder<'a, SetNumPaths<S>>
where S::NumPaths: IsUnset,

Optional (Some / Option setters). Default: 0.

Source

pub fn env(self, value: HashMap<String, String>) -> ExecBuilder<'a, SetEnv<S>>
where S::Env: IsUnset,

Optional (Some / Option setters). Default: <HashMap<String, String> as Default>::default().

Source

pub fn maybe_env( self, value: Option<HashMap<String, String>>, ) -> ExecBuilder<'a, SetEnv<S>>
where S::Env: IsUnset,

Optional (Some / Option setters). Default: <HashMap<String, String> as Default>::default().

Source

pub fn ok_exit_codes( self, value: &'a [i32], ) -> ExecBuilder<'a, SetOkExitCodes<S>>
where S::OkExitCodes: IsUnset,

Required.

Source

pub fn ignore_stderr( self, value: Vec<Regex>, ) -> ExecBuilder<'a, SetIgnoreStderr<S>>
where S::IgnoreStderr: IsUnset,

Optional (Some / Option setters). Default: <Vec<Regex> as Default>::default().

Source

pub fn maybe_ignore_stderr( self, value: Option<Vec<Regex>>, ) -> ExecBuilder<'a, SetIgnoreStderr<S>>
where S::IgnoreStderr: IsUnset,

Optional (Some / Option setters). Default: <Vec<Regex> as Default>::default().

Source

pub fn in_dir(self, value: &'a Path) -> ExecBuilder<'a, SetInDir<S>>
where S::InDir: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_in_dir( self, value: Option<&'a Path>, ) -> ExecBuilder<'a, SetInDir<S>>
where S::InDir: IsUnset,

Optional (Some / Option setters).

Auto Trait Implementations§

§

impl<'a, S> Freeze for ExecBuilder<'a, S>

§

impl<'a, S> RefUnwindSafe for ExecBuilder<'a, S>

§

impl<'a, S> Send for ExecBuilder<'a, S>

§

impl<'a, S> Sync for ExecBuilder<'a, S>

§

impl<'a, S> Unpin for ExecBuilder<'a, S>

§

impl<'a, S> UnsafeUnpin for ExecBuilder<'a, S>

§

impl<'a, S> UnwindSafe for ExecBuilder<'a, S>

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.