nodyn 0.2.0: Easy polymorphism using enums with Vec Wrapper Support
Hello Rustaceans! nodyn 0.2.0 is out, enhancing Rust’s enum wrappers with a new Vec wrapper for polymorphic collections. Here’s a quick example:
nodyn::nodyn! {
#[derive(Debug]
pub enum Item { i32, String }
vec Inventory;
}
let mut inv = inventory![100, "sword".to_string()];
inv.push(50);
assert_eq!(inv.iter_i32().sum::<i32>(), 150); // Counts gold coins
New features of 0.2.0 include generation of polymorphic Vecs with a vec!-like macro & variant methods (e.g., first_i32). In addition optional code generation can now be selected using impl directives for fine-grained control. See Changelog