5 releases (3 breaking)

Uses old Rust 2015

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

#573 in Rust patterns

Download history 82/week @ 2022-08-15 97/week @ 2022-08-22 69/week @ 2022-08-29 183/week @ 2022-09-05 137/week @ 2022-09-12 95/week @ 2022-09-19 212/week @ 2022-09-26 225/week @ 2022-10-03 103/week @ 2022-10-10 60/week @ 2022-10-17 460/week @ 2022-10-24 182/week @ 2022-10-31 344/week @ 2022-11-07 483/week @ 2022-11-14 119/week @ 2022-11-21 145/week @ 2022-11-28

1,091 downloads per month
Used in 42 crates (17 directly)

MPL-2.0 license

55KB
884 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

Features

  • unstable-filter-as-fn