MCPcopy Index your code
hub / github.com/assert-rs/assert_cmd / IntoCodePredicate

Interface IntoCodePredicate

src/assert.rs:555–564  ·  view source on GitHub ↗

Used by [`Assert::code`] to convert `Self` into the needed [`predicates_core::Predicate `]. # Examples ```rust,no_run use assert_cmd::prelude::*; use std::process::Command; use predicates::prelude::*; Command::cargo_bin("bin_fixture") .unwrap() .env("exit", "42") .assert() .code(predicate::eq(42)); // which can be shortened to: Command::cargo_bin("bin_fixture") .unwrap() .env("exit", "42"

Source from the content-addressed store, hash-verified

553/// .code(42);
554/// ```
555pub trait IntoCodePredicate<P>
556where
557 P: predicates_core::Predicate<i32>,
558{
559 /// The type of the predicate being returned.
560 type Predicate;
561
562 /// Convert to a predicate for testing a program's exit code.
563 fn into_code(self) -> P;
564}
565
566impl<P> IntoCodePredicate<P> for P
567where

Callers

nothing calls this directly

Implementers 1

assert.rssrc/assert.rs

Calls

no outgoing calls

Tested by

no test coverage detected