cl-traits

Crates.iocl-traits
lib.rscl-traits
version7.0.0
sourcesrc
created_at2019-03-08 23:08:46.462064
updated_at2022-05-19 18:42:21.186323
descriptionProvides traits that describe collections
homepage
repositoryhttps://github.com/c410-f3r/cl-traits
max_upload_size
id119547
size110,693
Caio (c410-f3r)

documentation

README

Collection Traits (cl-traits)

CI crates.io Documentation License Rustc

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);
}
Commit count: 0

cargo fmt