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 for BinaryFilePredicate
impl PartialEq 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 StructuralPartialEq for BinaryFilePredicate
Auto Trait Implementations§
impl Freeze for BinaryFilePredicate
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<P, Item> PredicateBooleanExt<Item> for P
impl<P, Item> PredicateBooleanExt<Item> for P
source§fn and<B>(self, other: B) -> AndPredicate<Self, B, Item>
fn and<B>(self, other: B) -> AndPredicate<Self, B, Item>
Compute the logical AND of two
Predicate
results, returning the result. Read moresource§fn or<B>(self, other: B) -> OrPredicate<Self, B, Item>
fn or<B>(self, other: B) -> OrPredicate<Self, B, Item>
Compute the logical OR of two
Predicate
results, returning the result. Read more