3 ms·
Typeables provides better typesafety and encapsulation by using the Rust pattern of "New Type", which defines a struct tuple that wraps the original type. This
by jph 5y ago
Typeables provides better typesafety and encapsulation by using the Rust pattern of "New Type", which defines a struct tuple that wraps the original type.
This can be especially helpful for scientific units, and for types where structure is helpful such as content types (e.g. a phone number is really a string not a number), media types (e.g. MIME), and more.
If you like the Rust crate "uom" or functions with strong types, then you may like Typeables.
I'm the author and happy to answer questions. I welcome constructive feedback.
https://crates.io/crates/typeables https://crates.io/crates/typeables
https://github.com/SixArm/typeables-rust-crate https://github.com/SixArm/typeables-rust-crate