File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,27 @@ use objc2::Message;
1717/// A type used to mark that a struct owns the object(s) it contains,
1818/// so it has the sole references to them.
1919pub enum Owned { }
20+
2021/// A type used to mark that the object(s) a struct contains are shared,
2122/// so there may be other references to them.
2223pub enum Shared { }
2324
25+ mod private {
26+ pub trait Sealed { }
27+
28+ impl Sealed for super :: Owned { }
29+ impl Sealed for super :: Shared { }
30+ }
31+
2432/// A type that marks what type of ownership a struct has over the object(s)
2533/// it contains; specifically, either [`Owned`] or [`Shared`].
26- pub trait Ownership : Any { }
27- impl Ownership for Owned { }
28- impl Ownership for Shared { }
34+ ///
35+ /// This trait is sealed and not meant to be implemented outside of the this
36+ /// crate.
37+ pub trait Ownership : private:: Sealed { }
38+
39+ impl Ownership for super :: Owned { }
40+ impl Ownership for super :: Shared { }
2941
3042/// An pointer for Objective-C reference counted objects.
3143///
You can’t perform that action at this time.
0 commit comments