Rust Extension Methods
An example of using Extention Methods to pimp my library with a json generating method. The idea is that you have a clean create with the library code and a seperate create with the extention methods. This avoids having 3rd party marcos like
serde as a dependency on your clean library code.
This project is a workspace containing two libraries and a binary project.
The libraries are:
some_librarywhich contains an enum
Shape. This library has no external dependencies.
some_extentioncontains a trait
JSONwhich adds an Extention Method
Shapeby wrapping it in
Shaperto get around the Orphan rules. The
Shaperclass uses the serde remote derive technique Deriving De/Serialize for type in a different crate