Nodyn 0.2.0: Easy polymorphism using enums with Vec Wrapper Support

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

Try it out: Crates.io | Docs.rs | GitHub

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.