sbailleul / mapper Goto Github PK
View Code? Open in Web Editor NEWProvides a derive macro for generate mapping without boilerplate.
Home Page: https://docs.rs/crate/mapper/latest
Provides a derive macro for generate mapping without boilerplate.
Home Page: https://docs.rs/crate/mapper/latest
On field to attribute add a flag exclude to exclude the decorated field from mapping.
Current behavior (substractive mapping) : If destination is set in struct to attribute all field except those flagged with excluded will be mapped.
Added behavior (additive mapping) : Destination not mandatory in the to struct attribute, all field with to attribute will be added to mapping. Add control on exclude flag to disable it in this specific case.
Configuration available on the struct #[to] attribute.
Two values available :
*into, generate automatic Into implementation.
*mapper (default), generate automatic Mapper implementation.
E.g : #[to(Person, strategy=mapper, strategy=into)]
This change will impact with configuration in the #[to] field attribute see : Adapt with configuration field in regards of to the mapping strategy
Add strategy configuration on to field attribute in case of additive mapping.
Specify target strategy of the with configuration by using syntax : with(strategy)
If no strategy is specified take default strategy mapper.
If into strategy is used signature of the function specified should be : fn foo(val: src_field_type) -> dst_field_type;
If mapper strategy is used signature of the function specified should be : fn foo(val: & src_field_type) -> dst_field_type;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.