Auxiliary elements for collections
For traits, this crate provides a single method for each operation to achieve maximum flexibility and freedom instead of imposing abstract subsets.
Examples
use *;
;
For traits, this crate provides a single method for each operation to achieve maximum flexibility and freedom instead of imposing abstract subsets.
use cl_aux::*;
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);
}