Expand description
Splits the contained string by whitespace (using split_whitespace
)
and uses the resulting words as separate arguments.
use cradle::prelude::*;
let StdoutTrimmed(output) = run_output!(Split("echo foo"));
assert_eq!(output, "foo");
let StdoutTrimmed(output) = run_output!(Split(format!("echo {}", 100)));
assert_eq!(output, "100");
Since this is such a common case, cradle
also provides a syntactic shortcut
for Split
, the %
symbol:
use cradle::prelude::*;
let StdoutTrimmed(output) = run_output!(%"echo foo");
assert_eq!(output, "foo");
Formats the value using the given formatter. Read more
input.run()
runs input
as a child process.
It’s equivalent to run!(input)
. Read more
input.run()
runs input
as a child process.
It’s equivalent to run_output!(input)
. Read more
input.run_result()
runs input
as a child process.
It’s equivalent to run_result!(input)
. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.