Trait inline_c::predicates::PredicateFileContentExt [−][src]
Predicate extension adapting a slice Predicate.
Provided methods
pub fn from_file_path(self) -> FileContentPredicate<Self>[src]
Returns a FileContentPredicate that adapts Self to a file content Predicate.
Examples
use predicates::prelude::*; use std::path::Path; let predicate_fn = predicate::str::is_empty().not().from_utf8().from_file_path(); assert_eq!(true, predicate_fn.eval(Path::new("./tests/hello_world"))); assert_eq!(false, predicate_fn.eval(Path::new("./tests/empty_file")));