-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: introduce RestrictAccess<To>
and generalize restrict
to all access types
#60
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice abstraction! It makes things a bit more complex, but also more flexible.
I think it would be a good idea to do the breaking release quickly and remove the associated RestrictShared
type. Otherwise I fear that the two ways to restrict access could lead to confusion. What do you think?
Ready for merge from my side after a rebase.
Signed-off-by: Martin Kröning <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
…irectly Signed-off-by: Martin Kröning <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
…stent Signed-off-by: Martin Kröning <[email protected]>
Works for me. I rebased, removed |
0ac779e
to
c64c9af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates!
This PR introduces
trait RestrictAccess<T>
to generalize the restriction from any access type to any other access type, to implementVolatile{Ptr,Ref}::restrict
generically for all access types.While not required, this PR also replaces and deprecates
Access::RestrictShared
, since it is equivalent toRestrictAccess<ReadOnly>::Restricted
.Though also optional, I implemented
Readable
,Writable
, andCopyable
in terms ofRestrictAccess
.This PR depends on #59.