You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it seems the generated accessors are private. Is there a way to generate them with a different visibility, e.g. pub or pub(crate).
I need this because I define my enum in one Module, but need the accessors in another module.
Sample code:
mod mod_a {#[derive(Hash,Eq,PartialEq,Debug,Clone,Copy,EnumAccess)]#[enum_access(get(name))]pubenumFactor{SingleValue{name:String},MultipleValue{name:String}}}mod mod_b {usesuper::mod_a::Factor;fnmy_fn(){let factor = Factor::SingleValue{name:"Foo".to_string()};
factor.name();// error[E0624]: method `name` is private}}
The text was updated successfully, but these errors were encountered:
kije
changed the title
How can I set the visibility of the generated ccessors from EnumAccess?
How can I set the visibility of the generated accessors from EnumAccess?
Sep 10, 2023
Currently it seems the generated accessors are private. Is there a way to generate them with a different visibility, e.g.
pub
orpub(crate)
.I need this because I define my enum in one Module, but need the accessors in another module.
Sample code:
The text was updated successfully, but these errors were encountered: