Struct predicates::path::BinaryFilePredicate [−][src]
pub struct BinaryFilePredicate { /* fields omitted */ }
Predicate that compares file matches
Methods
impl BinaryFilePredicate
[src]
impl BinaryFilePredicate
pub fn utf8(self) -> Option<StrFilePredicate>
[src]
pub fn utf8(self) -> Option<StrFilePredicate>
Creates a new Predicate
that ensures complete equality
Examples
use std::path::Path; use predicates::prelude::*; let predicate_file = predicate::path::eq_file(Path::new("Cargo.toml")).utf8().unwrap(); assert_eq!(true, predicate_file.eval(Path::new("Cargo.toml"))); assert_eq!(false, predicate_file.eval(Path::new("Cargo.lock"))); assert_eq!(false, predicate_file.eval(Path::new("src"))); assert_eq!(false, predicate_file.eval("Not a real Cargo.toml file content"));
Trait Implementations
impl Debug for BinaryFilePredicate
[src]
impl Debug for BinaryFilePredicate
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for BinaryFilePredicate
[src]
impl Clone for BinaryFilePredicate
fn clone(&self) -> BinaryFilePredicate
[src]
fn clone(&self) -> BinaryFilePredicate
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for BinaryFilePredicate
[src]
impl PartialEq for BinaryFilePredicate
fn eq(&self, other: &BinaryFilePredicate) -> bool
[src]
fn eq(&self, other: &BinaryFilePredicate) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &BinaryFilePredicate) -> bool
[src]
fn ne(&self, other: &BinaryFilePredicate) -> bool
This method tests for !=
.
impl Eq for BinaryFilePredicate
[src]
impl Eq for BinaryFilePredicate
impl Predicate<Path> for BinaryFilePredicate
[src]
impl Predicate<Path> for BinaryFilePredicate
fn eval(&self, path: &Path) -> bool
[src]
fn eval(&self, path: &Path) -> bool
Execute this Predicate
against variable
, returning the resulting boolean. Read more
fn find_case<'a>(&'a self, expected: bool, variable: &Path) -> Option<Case<'a>>
[src]
fn find_case<'a>(&'a self, expected: bool, variable: &Path) -> Option<Case<'a>>
Find a case that proves this predicate as expected
when run against variable
.
impl Predicate<[u8]> for BinaryFilePredicate
[src]
impl Predicate<[u8]> for BinaryFilePredicate
fn eval(&self, actual: &[u8]) -> bool
[src]
fn eval(&self, actual: &[u8]) -> bool
Execute this Predicate
against variable
, returning the resulting boolean. Read more
fn find_case<'a>(&'a self, expected: bool, variable: &[u8]) -> Option<Case<'a>>
[src]
fn find_case<'a>(&'a self, expected: bool, variable: &[u8]) -> Option<Case<'a>>
Find a case that proves this predicate as expected
when run against variable
.
impl PredicateReflection for BinaryFilePredicate
[src]
impl PredicateReflection for BinaryFilePredicate
ⓘImportant traits for Box<R>fn parameters<'a>(&'a self) -> Box<Iterator<Item = Parameter<'a>> + 'a>
[src]
ⓘImportant traits for Box<R>
fn parameters<'a>(&'a self) -> Box<Iterator<Item = Parameter<'a>> + 'a>
Parameters of the current Predicate
.
ⓘImportant traits for Box<R>fn children(&'a self) -> Box<Iterator<Item = Child<'a>> + 'a>
[src]
ⓘImportant traits for Box<R>
fn children(&'a self) -> Box<Iterator<Item = Child<'a>> + 'a>
Nested Predicate
s of the current Predicate
.
impl Display for BinaryFilePredicate
[src]
impl Display for BinaryFilePredicate
Auto Trait Implementations
impl Send for BinaryFilePredicate
impl Send for BinaryFilePredicate
impl Sync for BinaryFilePredicate
impl Sync for BinaryFilePredicate