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
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 ofHasContext
, and would need to accommodate for these new methods. However, most users ofglow
do not implement theHasContext
trait and only act as consumers of it. This means that downstream crates have to constantly updateglow
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-privateSealed
trait that is needed for implementors ofHasContext
. This makes it so methods can be freely added toHasContext
without needing to release a new breaking version ofglow
.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