Rc and Arc have a number of methods in common, which of them should be required for RefCountFamily?
Obviously this is a judgment call. The fewer methods we require, the more implementations can implement the trait. The current requires of Deref<Target = T> + Clone and new, are so broad that we could even implement it for Box. The more methods we require, the more complicated implementations can be generic. I am personally very fond of make_mut, but different people will disagree about which ones are critical.
As a pre-RFC research project, this question could probably be generalized to "for all methods implemented by Rc and Arc which ones can't be added to the trait and why?"
I would also be interested whether there some way to split up the methods that involve Weak into a substrait. So that WeekCountFamily requires RefCountFamily and adds the functionality for Weak pointers.
Rc and Arc have a number of methods in common, which of them should be required for
RefCountFamily?Obviously this is a judgment call. The fewer methods we require, the more implementations can implement the trait. The current requires of
Deref<Target = T> + Cloneandnew, are so broad that we could even implement it forBox. The more methods we require, the more complicated implementations can be generic. I am personally very fond of make_mut, but different people will disagree about which ones are critical.As a pre-RFC research project, this question could probably be generalized to "for all methods implemented by Rc and Arc which ones can't be added to the trait and why?"
I would also be interested whether there some way to split up the methods that involve
Weakinto a substrait. So thatWeekCountFamilyrequiresRefCountFamilyand adds the functionality forWeakpointers.