predicates/
prelude.rs

1// Copyright (c) 2018 The predicates-rs Project Developers.
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9//! Module that contains the essentials for working with predicates.
10
11pub use crate::boolean::PredicateBooleanExt;
12pub use crate::boxed::PredicateBoxExt;
13pub use crate::name::PredicateNameExt;
14pub use crate::path::PredicateFileContentExt;
15pub use crate::str::PredicateStrExt;
16pub use crate::Predicate;
17
18/// Predicate factories
19pub mod predicate {
20    // primitive `Predicate` types
21    pub use crate::constant::{always, never};
22    pub use crate::function::function;
23    pub use crate::iter::{in_hash, in_iter};
24    pub use crate::ord::{eq, ge, gt, le, lt, ne};
25
26    /// `str` Predicate factories
27    ///
28    /// This module contains predicates specific to string handling.
29    pub mod str {
30        pub use crate::str::is_empty;
31        pub use crate::str::{contains, ends_with, starts_with};
32
33        #[cfg(feature = "difference")]
34        pub use crate::str::{diff, similar};
35
36        #[cfg(feature = "regex")]
37        pub use crate::str::is_match;
38    }
39
40    /// `Path` Predicate factories
41    ///
42    /// This module contains predicates specific to path handling.
43    pub mod path {
44        pub use crate::path::eq_file;
45        pub use crate::path::{exists, missing};
46        pub use crate::path::{is_dir, is_file, is_symlink};
47    }
48
49    /// `f64` Predicate factories
50    ///
51    /// This module contains predicates specific to float handling.
52    pub mod float {
53        #[cfg(feature = "float-cmp")]
54        pub use crate::float::is_close;
55    }
56}