Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publicly expose the capability module #512

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

petrosagg
Copy link
Contributor

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 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](https://rust-lang.github.io/api-guidelines/future-proofing.html)
to prevent any foreign crate from implementing `CapabilityTrait`.

Signed-off-by: Petros Angelatos <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant