3 unstable releases

0.7.0 May 30, 2022
0.6.1 May 28, 2022
0.6.0 May 11, 2022

#1547 in Data structures

Download history 582/week @ 2023-08-05 463/week @ 2023-08-12 1030/week @ 2023-08-19 600/week @ 2023-08-26 326/week @ 2023-09-02 320/week @ 2023-09-09 727/week @ 2023-09-16 648/week @ 2023-09-23 1530/week @ 2023-09-30 1062/week @ 2023-10-07 1107/week @ 2023-10-14 1369/week @ 2023-10-21 850/week @ 2023-10-28 950/week @ 2023-11-04 878/week @ 2023-11-11 615/week @ 2023-11-18

3,605 downloads per month
Used in 7 crates (2 directly)

MIT license

16KB
143 lines

🦀 ErasedSet

A set of erased types.


You may be looking for:

License

Licensed under MIT license.


lib.rs:

🦀 ErasedSet

You may be looking for:


This crate provides a new collection: The ErasedSet.

It can store any type T: Any.

Example

#
use erased_set::ErasedSet;

let mut set = ErasedSet::new();
set.insert(ClickEvent(128, 256));
set.insert(KeyDownEvent('z'));

assert_eq!(set.get::<ClickEvent>(), Some(&ClickEvent(128, 256)));

assert_eq!(set.insert(KeyDownEvent('e')), Some(KeyDownEvent('z')));

set.remove::<ClickEvent>();

assert_eq!(set.len(), 1);

Features

name default ? description
send yes Enables ErasedSendSet
sync yes Enables ErasedSyncSet

no_std support

This crate is no_std compatible, however it still requires alloc.

No runtime deps