File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 11use alloc:: borrow;
22use alloc:: boxed:: Box ;
3- use core:: any:: Any ;
43use core:: cell:: UnsafeCell ;
54use core:: fmt;
65use core:: hash;
@@ -17,13 +16,25 @@ use objc2::Message;
1716/// A type used to mark that a struct owns the object(s) it contains,
1817/// so it has the sole references to them.
1918pub enum Owned { }
19+
2020/// A type used to mark that the object(s) a struct contains are shared,
2121/// so there may be other references to them.
2222pub enum Shared { }
2323
24+ mod private {
25+ pub trait Sealed { }
26+
27+ impl Sealed for super :: Owned { }
28+ impl Sealed for super :: Shared { }
29+ }
30+
2431/// A type that marks what type of ownership a struct has over the object(s)
2532/// it contains; specifically, either [`Owned`] or [`Shared`].
26- pub trait Ownership : Any { }
33+ ///
34+ /// This trait is sealed and not meant to be implemented outside of the this
35+ /// crate.
36+ pub trait Ownership : private:: Sealed + ' static { }
37+
2738impl Ownership for Owned { }
2839impl Ownership for Shared { }
2940
You can’t perform that action at this time.
0 commit comments