Crates.io | collect-rs |
lib.rs | collect-rs |
version | |
source | src |
created_at | 2024-09-24 05:50:17.218318 |
updated_at | 2024-11-02 22:27:24.15006 |
description | Special and custom Collections and Containers (for Rust) |
homepage | https://github.com/synesissoftware/collect-rs |
repository | https://github.com/synesissoftware/collect-rs |
max_upload_size | |
id | 1384802 |
Cargo.toml error: | TOML parse error at line 21, column 1 | 21 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Special and custom Collections and Containers for Rust
Reference in Cargo.toml in the usual way:
collect-rs = { version = "0.1" }
No public constants are defined at this time.
No public enumerations are defined at this time.
No public functions are defined at this time.
No public macros are defined at this time.
FrequencyMap<K>
- a container that measures the frequencies of the unique elements it contains;
UnicodePointMap
- a specialised container that measures the frequencies of Unicode code-points;
No public traits are defined at this time.
The following are terse examples of some of the components provided in the crate. See the examples directory for more.
FrequencyMap
let mut fm = FrequencyMap::default();
fm.push("cat");
fm.push("dog");
fm.push("dog");
assert_eq!(1, fm.get("cat"));
assert_eq!(2, fm.get("dog"));
assert_eq!(0, fm.get("mouse"));
UnicodePointMap
let upm = UnicodePointMap::from_iter("The quick brown fox jumps over the lazy dog".chars().into_iter());
assert_eq!(1, upm['a']);
assert_eq!(1, upm['b']);
assert_eq!(1, upm['c']);
assert_eq!(1, upm['d']);
assert_eq!(3, upm['e']);
assert_eq!(1, upm['f']);
assert_eq!(1, upm['g']);
assert_eq!(2, upm['h']);
assert_eq!(1, upm['i']);
assert_eq!(1, upm['j']);
assert_eq!(1, upm['k']);
assert_eq!(1, upm['l']);
assert_eq!(1, upm['m']);
assert_eq!(1, upm['n']);
assert_eq!(4, upm['o']);
assert_eq!(1, upm['p']);
assert_eq!(1, upm['q']);
assert_eq!(2, upm['r']);
assert_eq!(1, upm['s']);
assert_eq!(1, upm['t']);
assert_eq!(2, upm['u']);
assert_eq!(1, upm['v']);
assert_eq!(1, upm['w']);
assert_eq!(1, upm['x']);
assert_eq!(1, upm['y']);
assert_eq!(1, upm['z']);
assert_eq!(8, upm[' ']);
assert_eq!(1, upm['T']);
assert_eq!(0, upm['0']);
assert_eq!(0, upm['-']);
assert_eq!(0, upm['_']);
assert_eq!(0, upm['.']);
assert_eq!(0, upm[',']);
Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/collect-rs.
Crates upon which collect-rs depend:
Crates upon which collect-rs depend:
None at this time.
collect-rs is released under the 3-clause BSD license. See LICENSE for details.