26 releases (15 stable)
7.0.0 | May 19, 2022 |
---|---|
6.0.0 | Jul 18, 2021 |
5.0.1 | May 3, 2021 |
5.0.0 | Jan 29, 2021 |
0.1.0 | Mar 12, 2019 |
#46 in #collections
77 downloads per month
Used in 5 crates
(4 directly)
99KB
2.5K
SLoC
Collection Traits (cl-traits)
Yet another library that generalizes collections.
This crate provides a single method for each trait
to achieve maximum flexibility and freedom instead of imposing an abstraction subset for all situations and users.
Examples
use cl_traits::*;
struct SomeCustomVector(Vec<i32>, Vec<i32>);
impl Length for SomeCustomVector {
#[inline]
fn length(&self) -> usize {
self.0.length() + self.1.length()
}
}
fn main() {
let v = SomeCustomVector(vec![1, 2], vec![3, 4, 5, 6]);
assert_eq!(v.length(), 6);
}
Dependencies
~0–345KB