{"repo":"TedDriggs/darling","free":true,"listed":false,"github":"https://github.com/TedDriggs/darling","clone":"git clone https://github.com/TedDriggs/darling.git","description":"A Rust proc-macro attribute parser","language":"Rust","stars":1266,"topics":["rust","proc-macro"],"license":"MIT","category":"dev-tools","readme_excerpt":"Darling darling is a crate for proc macro authors, which enables parsing attributes into structs. It is heavily inspired by serde both in its internals and in its API. Benefits - Easy and declarative parsing of macro input - make your proc-macros highly controllable with minimal time investment. - Great validation and errors, no work required. When users of your proc-macro make a mistake, darling makes sure they get error markers at the right place in their source, and provides \"did you mean\" suggestions for misspelled fields. Usage darling provides a set of traits which can be derived or manually implemented. 1. FromMeta is used to extract values from a meta-item in an attribute. Implementations are likely reusable for many libraries, much like FromStr or serde::Deserialize . Trait implementations are provided for primitives, some std types, and some syn types. 2. FromDeriveInput is implemented or derived by each proc-macro crate which depends on darling . This is the root for input parsing; it gets access to the identity, generics, and visibility of the target type, and can specify which attribute names should be parsed or forwarded from the input AST. 3. FromField is implemented or derived by each proc-macro crate which depends on darling . Structs deriving this trait will get access to the identity (if it exists), type, and visibility of the field. 4. FromVariant is implemented or derived by each proc-macro crate which depends on darling . Structs deriving this trait will","default_branch":null,"files":null,"tree":[],"storefront":"/r/TedDriggs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/TedDriggs/darling/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}