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 -
Replying to @littlecalculist @rustlang
Nothing should be duplicated. The http crate might seem complicated, but can just put your Sealed trait in an inner module, and that's it.
1 reply 0 retweets 0 likes -
-
Replying to @littlecalculist @rustlang
Sorry, the inner module is not pub, the trait inside it is.
1 reply 0 retweets 0 likes -
Replying to @seanmonstar @rustlang
So the problem is that other modules in the *crate* need access. I can't just make it private to the parent module.
1 reply 0 retweets 0 likes -
This is why I ended up with two parallel hierarchies: the crate-internal one and the public one.
1 reply 0 retweets 0 likes -
Which is suuuuuuch a pain to work with.
1 reply 0 retweets 1 like
Link? I think we can make it better :)
-
-
Replying to @seanmonstar @rustlang
See Scope and ScopeInternal in https://github.com/neon-bindings/neon/blob/master/src/internal/scope.rs …
1 reply 0 retweets 0 likes -
The internal methods (e.g. .isolate()) are used in non nested modules like js::class: https://github.com/neon-bindings/neon/blob/master/src/internal/js/class.rs …
2 replies 0 retweets 0 likes - 13 more replies
New conversation -
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.