File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,27 @@ use objc2::Message;
17
17
/// A type used to mark that a struct owns the object(s) it contains,
18
18
/// so it has the sole references to them.
19
19
pub enum Owned { }
20
+
20
21
/// A type used to mark that the object(s) a struct contains are shared,
21
22
/// so there may be other references to them.
22
23
pub enum Shared { }
23
24
25
+ mod private {
26
+ pub trait Sealed { }
27
+
28
+ impl Sealed for super :: Owned { }
29
+ impl Sealed for super :: Shared { }
30
+ }
31
+
24
32
/// A type that marks what type of ownership a struct has over the object(s)
25
33
/// 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 { }
29
41
30
42
/// An pointer for Objective-C reference counted objects.
31
43
///
You can’t perform that action at this time.
0 commit comments