Struct assert_cmd::assert::InCodePredicate[][src]

pub struct InCodePredicate(_);
Expand description

Keep predicates concrete Predicates out of our public API. predicates_core::Predicate used by IntoCodePredicate for iterables of codes.

Example

use assert_cmd::prelude::*;

use std::process::Command;

Command::cargo_bin("bin_fixture")
    .unwrap()
    .env("exit", "42")
    .assert()
    .code(&[2, 42] as &[i32]);

Trait Implementations

impl Debug for InCodePredicate[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Display for InCodePredicate[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl IntoCodePredicate<InCodePredicate> for Vec<i32>[src]

type Predicate = InCodePredicate

The type of the predicate being returned.

fn into_code(self) -> Self::Predicate[src]

Convert to a predicate for testing a program’s exit code.

impl IntoCodePredicate<InCodePredicate> for &'static [i32][src]

type Predicate = InCodePredicate

The type of the predicate being returned.

fn into_code(self) -> Self::Predicate[src]

Convert to a predicate for testing a program’s exit code.

impl Predicate<i32> for InCodePredicate[src]

fn eval(&self, item: &i32) -> bool[src]

Execute this Predicate against variable, returning the resulting boolean. Read more

fn find_case<'a>(&'a self, expected: bool, variable: &i32) -> Option<Case<'a>>[src]

Find a case that proves this predicate as expected when run against variable.

impl PredicateReflection for InCodePredicate[src]

fn children<'a>(&'a self) -> Box<dyn Iterator<Item = Child<'a>> + 'a>[src]

Nested Predicates of the current Predicate.

fn parameters<'a>(&'a self) -> Box<dyn Iterator<Item = Parameter<'a>> + 'a>[src]

Parameters of the current Predicate.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<P> IntoCodePredicate<P> for P where
    P: Predicate<i32>, 
[src]

type Predicate = P

The type of the predicate being returned.

pub fn into_code(Self) -> <P as IntoCodePredicate<P>>::Predicate[src]

Convert to a predicate for testing a program’s exit code.

impl<P, Item> PredicateBooleanExt<Item> for P where
    P: Predicate<Item>,
    Item: ?Sized
[src]

fn and<B>(self, other: B) -> AndPredicate<Self, B, Item> where
    B: Predicate<Item>, 
[src]

Compute the logical AND of two Predicate results, returning the result. Read more

fn or<B>(self, other: B) -> OrPredicate<Self, B, Item> where
    B: Predicate<Item>, 
[src]

Compute the logical OR of two Predicate results, returning the result. Read more

fn not(self) -> NotPredicate<Self, Item>[src]

Compute the logical NOT of a Predicate, returning the result. Read more

impl<P, Item> PredicateBoxExt<Item> for P where
    P: Predicate<Item>, 
[src]

fn boxed(self) -> BoxPredicate<Item> where
    Self: Send + Sync + 'static, 
[src]

Returns a BoxPredicate wrapper around this Predicate type. Read more

impl<P, Item> PredicateNameExt<Item> for P where
    P: Predicate<Item>,
    Item: ?Sized
[src]

fn name(self, name: &'static str) -> NamePredicate<Self, Item>[src]

Name a predicate expression. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.