functor_derive-0.0.2 has been yanked.
Functor Derive
This crate can generate a Functor for generic structs and enums.
A Functor represents a type that can apply a function to its inner values
and produce new values of the same structure. This allows you to transform
the contents of a container (or any type) without changing the shape of the container.
use Functor;
use Functor;
How to Contribute
This crate works for almost any struct or enum definition. It can handle arrays, tuples, and nested types perfectly.
- Structs
- Named
- Unnamed
- Unit - Rust does not allow generic Unit Structs.
- Enums
- Named variants
- Unnamed variants
- Unit variants
- Arrays
- Tuples
-
std::collections: Vec, VecDeque, LinkedList, HashMap*, BTreeMap*, Result, Option, PhantomData
*The values are mapped.
If you find a case where the derive macro fails, feel free to open an issue here