11 releases (5 breaking)

Uses old Rust 2015

0.6.1 Jul 6, 2017
0.6.0 Jul 5, 2017
0.5.0 May 9, 2017
0.4.0 Apr 13, 2017
0.1.0 Mar 6, 2017

#985 in Data structures

Download history 256/week @ 2021-08-19 229/week @ 2021-08-26 149/week @ 2021-09-02 233/week @ 2021-09-09 212/week @ 2021-09-16 147/week @ 2021-09-23 186/week @ 2021-09-30 120/week @ 2021-10-07 128/week @ 2021-10-14 148/week @ 2021-10-21 112/week @ 2021-10-28 111/week @ 2021-11-04 118/week @ 2021-11-11 135/week @ 2021-11-18 157/week @ 2021-11-25 167/week @ 2021-12-02

583 downloads per month
Used in 10 crates (6 directly)

CC0 license

30KB
398 lines

Len trait

Len trait for collections. You may freely use and modify this code under the CC0 1.0 Universal License.

Usage

To use in your own project, just add the below to your Cargo.toml file.

[dependencies]
len-trait = "0.6"

For more formal documentation, you can find the rustdoc here.


lib.rs:

This crate generalises traits over the len and capacity methods found in most collections.

Methods that are included:

Additionally, the traits IndexRange<Idx> and IndexRangeMut<Idx> are provided for "consistent slicing," i.e. slicing over all range types.

Modules

The len module provides:

The capacity module provides:

The index module provides:

Features

The alloc and std features offer different tiers of implementations for different collections. The std feature automatically enables alloc. Although the std feature is the default, disabling it will enable no_std.

Dependencies

~8KB

q^Y