Struct predicates::path::BinaryFilePredicate
source · pub struct BinaryFilePredicate { /* private fields */ }
Expand description
Predicate that compares file matches
Implementations§
source§impl BinaryFilePredicate
impl BinaryFilePredicate
sourcepub fn utf8(self) -> Option<StrFilePredicate>
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§
source§impl Clone for BinaryFilePredicate
impl Clone for BinaryFilePredicate
source§fn clone(&self) -> BinaryFilePredicate
fn clone(&self) -> BinaryFilePredicate
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BinaryFilePredicate
impl Debug for BinaryFilePredicate
source§impl Display for BinaryFilePredicate
impl Display for BinaryFilePredicate
source§impl PartialEq<BinaryFilePredicate> for BinaryFilePredicate
impl PartialEq<BinaryFilePredicate> for BinaryFilePredicate
source§fn eq(&self, other: &BinaryFilePredicate) -> bool
fn eq(&self, other: &BinaryFilePredicate) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Predicate<[u8]> for BinaryFilePredicate
impl Predicate<[u8]> for BinaryFilePredicate
source§impl Predicate<Path> for BinaryFilePredicate
impl Predicate<Path> for BinaryFilePredicate
impl Eq for BinaryFilePredicate
impl StructuralEq for BinaryFilePredicate
impl StructuralPartialEq for BinaryFilePredicate
Auto Trait Implementations§
impl RefUnwindSafe for BinaryFilePredicate
impl Send for BinaryFilePredicate
impl Sync for BinaryFilePredicate
impl Unpin for BinaryFilePredicate
impl UnwindSafe for BinaryFilePredicate
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<P, Item> PredicateBooleanExt<Item> for Pwhere
P: Predicate<Item>,
Item: ?Sized,
impl<P, Item> PredicateBooleanExt<Item> for Pwhere P: Predicate<Item>, Item: ?Sized,
source§fn and<B>(self, other: B) -> AndPredicate<Self, B, Item>where
B: Predicate<Item>,
Self: Sized,
fn and<B>(self, other: B) -> AndPredicate<Self, B, Item>where B: Predicate<Item>, Self: Sized,
Compute the logical AND of two
Predicate
results, returning the result. Read more