4 releases (2 breaking)

0.3.0 Apr 29, 2018
0.2.0 Oct 6, 2017
0.1.1 Oct 14, 2016
0.1.0 Aug 12, 2016

#76 in Rust patterns

Download history 68/week @ 2019-10-14 192/week @ 2019-10-21 90/week @ 2019-10-28 142/week @ 2019-11-04 67/week @ 2019-11-11 77/week @ 2019-11-18 116/week @ 2019-11-25 51/week @ 2019-12-02 88/week @ 2019-12-09 206/week @ 2019-12-16 227/week @ 2019-12-23 434/week @ 2019-12-30 16/week @ 2020-01-06 44/week @ 2020-01-13 23/week @ 2020-01-20

517 downloads per month
Used in 41 crates (16 directly)

MPL-2.0 license

55KB
889 lines

filters

A library crate to build predicates and filter.

Documentation.

Build Status GitHub tag Crates.io Crates.io Crates.io Crates.io

Examples explain it best:

use filters::filter::Filter;

let not_eq_to_one   = |&a: &usize| { a != 1 };
let not_eq_to_two   = |&a: &usize| { a != 2 };
let not_eq_to_three = |&a: &usize| { a != 3 };

let a = not_eq_to_one.and(not_eq_to_two).and(not_eq_to_three);

assert_eq!(a.filter(&21), true);

For more examples have a look at the tests in ./src/filters.rs.

License

filters - A crate to build predicates/filters with the builder pattern
Copyright (C) 2016 Matthias Beyer

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

For more information and the full license text, see the LICENSE file.

No runtime deps