#sets #btree-set #hash-set #collection #find #b-tree

intersection

Find the intersection over a collection of sets; when you need more than the intersection between two sets

1 stable release

1.0.0 Dec 3, 2022

#1851 in Data structures

Download history 5/week @ 2024-07-28 1/week @ 2024-08-04 29/week @ 2024-08-18 33/week @ 2024-08-25 16/week @ 2024-09-01 24/week @ 2024-09-08 21/week @ 2024-09-15 22/week @ 2024-09-22 24/week @ 2024-09-29 12/week @ 2024-10-06 7/week @ 2024-10-13 21/week @ 2024-10-20 46/week @ 2024-10-27 10/week @ 2024-11-03

86 downloads per month

MIT/Apache

9KB

intersection

crates.io

Table of contents

Introduction

A crate to find the intersection between a collection of sets. Convenient when your collection of sets consists of more than 2 sets.

There are two options:

Why use this over HashSet::intersection or BTreeSet::intersection?

The standard library intersection methods require a bit of ceremony when you want to intersect 3 or more sets with each other. These intersection(other: &Set) methods produce a lazy iterator, which you then have to wrap into a HashSet::from_iter again. An alternative way is to use the BitAnd implementation of either set. In both cases it requires a bit of boilerplate which this library does for you ๐Ÿ˜„. Under the hood, this library uses BitAnd to produce an intersected set of the given input sets.

Contributions

Contributions, feedback or other correspondence are more than welcome! Feel free to send a message or create an issue ๐Ÿ˜„.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

No runtime deps