Struct cradle::input::Split [−][src]
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");
Tuple Fields
0: T
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Split<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Split<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more