filters

Crates.iofilters
lib.rsfilters
version0.4.0
sourcesrc
created_at2016-08-12 11:21:16.711026
updated_at2020-10-29 12:06:10.492096
descriptionBuild filters/predicates with the builder pattern
homepage
repositoryhttps://github.com/matthiasbeyer/filters
max_upload_size
id5958
size75,022
Matthias Beyer (matthiasbeyer)

documentation

https://matthiasbeyer.github.io/filters/filters/index.html

README

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.

Commit count: 137

cargo fmt