type-pools 0.1.0

A data structure to store values of multiple types
Documentation
  • Coverage
  • 72.22%
    13 out of 18 items documented0 out of 16 items with examples
  • Size
  • Source code size: 8.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.61 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • Jomy10/type-pools
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Jomy10

TypePools

Type pools are a data structure for storing values of multiple types. Values can be queried from their type.

An example

// Create a Type Pools structure
let mut pools = TypePools::new();

// Adding values
pools.push(1 as u32);
pools.push(2 as u32);
pools.push("Hello world");

// Query values
let int_pool = pools.type_pool::<u32>().unwrap();
let int_value: u32 = int_pool.values[0];
let string_value: &str = pools.get(0).unwrap();

License

The library is licensed under the MIT license