#collections #traits

no-std cl-aux

Provides elements that describe collections

11 stable releases (3 major)

4.4.0 Oct 23, 2023
3.0.0 Oct 19, 2023
2.2.0 Jul 15, 2023
2.0.0 Nov 26, 2022
1.1.0 Jul 31, 2022

#339 in Development tools

Download history 77/week @ 2023-10-28 84/week @ 2023-11-04 56/week @ 2023-11-11 41/week @ 2023-11-18 126/week @ 2023-11-25 47/week @ 2023-12-02 50/week @ 2023-12-09 98/week @ 2023-12-16 73/week @ 2023-12-23 49/week @ 2023-12-30 76/week @ 2024-01-06 88/week @ 2024-01-13 63/week @ 2024-01-20 119/week @ 2024-01-27 64/week @ 2024-02-03 200/week @ 2024-02-10

456 downloads per month
Used in 4 crates

Apache-2.0

99KB
3K SLoC

Auxiliary elements for collections

CI crates.io Documentation License Rustc

Provides well-defined traits with single methods that enable the achievement of maximum flexibility and freedom in several different operations instead of imposing abstract subsets.

use cl_aux::Length;

struct SomeCustomArray([i32; 2], [i32; 4]);

impl Length for SomeCustomArray {
  fn length(&self) -> usize {
    self.0.length() + self.1.length()
  }
}

fn main() {
  let v = SomeCustomArray([1, 2], [3, 4, 5, 6]);
  assert_eq!(v.length(), 6);
}

Also provides structures for common use-cases.

use cl_aux::ArrayWrapper;

fn main() {
  let _array: [usize; 1] = ArrayWrapper::from_fn(|idx| idx).0;
}

Dependencies

~0–275KB