Ohhhhh, amazing! It’s looking like the #rustlang restrictions RFC will likely be accepted!
This will remove the need for sealed traits, and will instead allow writing:
pub impl(crate) trait Foo {}
Which indicates the trait is public, but can only be implemented by the crate! It will also include:
pub struct Time {
pub mut(crate) millis: usize,
}
To enable fields to be marked read-only in public APIs!
github.com/rust-lang/rfcs/pull…
Restrictions by jhpratt · Pull Request #3323 · rust-lang/rfcs
(aka sealed traits and read-only fields, sort of) RenderedGitHub