Skip to main content

Command

Struct Command 

Source
pub struct Command { /* private fields */ }
Expand description

A program run for the duration of a test run.

Implementations§

Source§

impl Command

Source

pub fn new(name: &str, program: &str) -> Self

Source

pub fn arg(self, arg: &str) -> Self

Source

pub fn args<I: IntoIterator<Item = S>, S: AsRef<str>>(self, args: I) -> Self

Source

pub fn dir(self, dir: impl Into<PathBuf>) -> Self

Runs in this directory (a program that keeps its files where it runs).

Source

pub fn env(self, key: &str, value: &str) -> Self

Source

pub fn ready(self, ready: Ready) -> Self

Source

pub fn patience(self, patience: Duration) -> Self

How long to wait for it to be ready.

Source

pub fn hint(self, hint: &str) -> Self

What to say when the program is not there: how to get it.

Source

pub fn program(&self) -> &str

The program that is run.

Source

pub fn argv(&self) -> &[String]

Its arguments.

Source

pub fn working_dir(&self) -> Option<&Path>

The directory it runs in, if it has one of its own.

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Service for Command

Source§

fn name(&self) -> &str

What the tests call it.
Source§

fn unavailable(&self) -> Option<String>

Why it cannot run on this machine, and how to get it so that it can; None when it can.
Source§

fn start(&self) -> Result<Box<dyn Running>, String>

Starts it and waits until it is ready.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.