Closed
Description
I wrote in #4 (comment):
I really want this to generate idiomatic Rust, so getters names would be prefixed with
get_
, e.g.get_foo()
andget_foo_bar()
.If I read rust-lang/rust#29599 correctly, it's not possible to generate
ident
on stable. If we were to do getters on nightly only, interpolate_idents might be helpful (usage example).A more creative solution for stable might be creating a single
get(&self) -> new_sub_module::Getter
method, whereGetter
is a newtype that implements methods to get each of the struct fields, so you can dox.get().foo()
.