Question for @rustlang folks: is it impossible to use pub(crate) to emulate abstract classes? I've used facade modules successfully for it.
-
-
Replying to @littlecalculist @rustlang
In particular I can have `pub trait Public: Private` where Public is reexported but Private is not. If refactored to pub(crate), rustc error
2 replies 0 retweets 0 likes -
Replying to @littlecalculist @rustlang
Put the private super trait in an inner pub module that doesn't get re-exported. https://github.com/carllerche/http/blob/master/src/header/map.rs#L3111 …
1 reply 0 retweets 0 likes -
Replying to @seanmonstar @rustlang
Doesn't this mean a whole dup hierarchy? That's what I've been doing and I was hoping I didn't have to. 2x the # of modules is
2 replies 0 retweets 0 likes -
Hm that link shows a totally pub trait that's just using doc(hidden), not the facade module pattern.
1 reply 0 retweets 0 likes
It's a pub trait, that is never exported at the crate level. It has to be pub because of the private-in-public error.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.