Warning
This post was published 32 days ago. The information described in this article may have changed.
Nodyn 0.2.0: Easy polymorphism using enums with Vec Wrapper Support
โ Rust ๐ 2025-08-04 ๐ค surdeus ๐๏ธ 5nodyn 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
1 post - 1 participant
๐ท๏ธ Rust_feed