The CapabilityTrait trait is part of the public API of timely (e.g OutputHandle::session expects one), but the trait itself is not publicly accessible.
This is because implementing this trait would circumvent the safety properties of capabilities. However, not exposing it also prevents safe wrapping of handles to provide additional functionality on top of them.
This PR offers a solution by making the capability module public and using the sealed trait
pattern to prevent any foreign crate from implementing CapabilityTrait.
The
CapabilityTrait
trait is part of the public API oftimely
(e.gOutputHandle::session
expects one), but the trait itself is not publicly accessible.This is because implementing this trait would circumvent the safety properties of capabilities. However, not exposing it also prevents safe wrapping of handles to provide additional functionality on top of them.
This PR offers a solution by making the
capability
module public and using the sealed trait pattern to prevent any foreign crate from implementingCapabilityTrait
.