collect-rs

Crates.iocollect-rs
lib.rscollect-rs
version
sourcesrc
created_at2024-09-24 05:50:17.218318
updated_at2024-11-02 22:27:24.15006
descriptionSpecial and custom Collections and Containers (for Rust)
homepagehttps://github.com/synesissoftware/collect-rs
repositoryhttps://github.com/synesissoftware/collect-rs
max_upload_size
id1384802
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`
size0
(synesissoftware)

documentation

README

collect-rs

Special and custom Collections and Containers for Rust

Crates.io

Introduction

Table of Contents

Installation

Reference in Cargo.toml in the usual way:

collect-rs = { version = "0.1" }

Components

Constants

No public constants are defined at this time.

Enumerations

No public enumerations are defined at this time.

Functions

No public functions are defined at this time.

Macros

No public macros are defined at this time.

Structures

  • 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;

Traits

No public traits are defined at this time.

Examples

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[',']);

Project Information

Where to get help

GitHub Page

Contribution guidelines

Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/collect-rs.

Dependencies

Crates upon which collect-rs depend:

Dev Dependencies

Crates upon which collect-rs depend:

Related projects

None at this time.

License

collect-rs is released under the 3-clause BSD license. See LICENSE for details.

Commit count: 4

cargo fmt