Automation of Destructure Pattern
destructure is a automation library for destructure pattern.
What is destructure pattern?
A structure with too many fields makes it hard to call constructors, but it is also hard work to prepare a Getter/Setter for each one. There are macros for this purpose, but even so, a large number of macros reduces readability. This is especially true when using From<T> Trait.
So how can this be simplified? It is the technique of "converting all fields to public".
This allows for a simplified representation, as in the following example
There are several problems with this method, the most serious of which is the increase in boilerplate.
Using the multi-cursor feature of the editor, this can be done by copy-pasting, but it is still a hassle.
Therefore, I created a Procedural Macro that automatically generates structures and methods:
use Destructure;
Problem
It is still lacking in functionality, but we will accept PullRequests and Issues if there are any problems.