#traits #representing #data

yanked set

A simple trait representing a set of data

Uses old Rust 2015

0.1.1 May 25, 2017
0.1.0 May 25, 2017

#3 in #representing

MIT/Apache

4KB

A simple interface with methods for manipulating sets.

Examples

use set;
use set::Set;

// A set that contains ASCII
let ascii = set::predicate(|c| c as u32 <= 0x7F);
assert!(ascii.contains('a'));
assert!(!ascii.contains(''));

let s = set::predicate(|c: char| c.is_uppercase());
assert!(s.contains('B'));

// A char is a quine atom. That is, it is a set that contains only itself.
assert!('t'.contains('t'));

// Functions and closures that match the signature of contains are themselves sets.
assert!(char::is_lowercase.contains('b'));

No runtime deps

Features