Closed Fyko closed 11 months ago
I'm not sure that FromDeriveInput
is actually wrong here - notice that darling
never knows what trait name you're deriving, so I think it's fine to use it for this use-case. You would pass to #[darling(attributes(...))]
whichever attributes you want to read at the struct level, and I think you'd be fine.
You'd then use a custom type that derives FromField
to get access to the usage of read_query
on the fields.
Thanks for getting back to me. My codesample works, but I'm trying to figure out if I could go without adding a proc_macro_derive
, rather using proc_macro_attribute
.
Yes!
Howdy! I've been poking around some issues, namely #156 and #165, trying to figure out how to build a strong attribute macro. This is what I had in mind:
and what I hope to parse being:
I previously used
FromMeta
before needing to parse attributes on field members. I can't find any examples or paths to reach this goal without also needing to derive a proc macro above theread_query
attribute.