Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In the current iteration of this crate, a new breaking change is needed every time a method is added to the `HasContext` trait. This is because a downstream crate could theoretically provide its own implementation of `HasContext`, and would need to accommodate for these new methods. However, most users of `glow` do not implement the `HasContext` trait and only act as consumers of it. This means that downstream crates have to constantly update `glow` to take advantage of new updates, which can be annoying. This commit makes it so it is impossible to implement the `HasContext` trait outside of this crate. It does this by making a crate-private `Sealed` trait that is needed for implementors of `HasContext`. This makes it so methods can be freely added to `HasContext` without needing to release a new breaking version of `glow`. The goal of this change is to make `glow` v1.0.0 possible. With this change it should be possible to release a stable API, assuming none of the other APIs need to be changed or removed in any way. The downside of this change is that it becomes impossible to implement `HasContext` outside of this crate. I would be genuinely shocked if any such implementations existed. Signed-off-by: John Nunley <[email protected]>
- Loading branch information