SubjectCopy | By default, Subject can only emit item which implemented Copy ,
that because subject is a multicast stream, need pass item to multi
subscriber.
But Copy bound is not perfect to subject. Like &mut T should be emitted
by Subject , because Subject just immediately pass it to subscribers and
never alias it, but &mut T is not Copy .
So we introduced SubjectCopy , it's only use to support Item be passed
to many subscriber in Subject . The drawback is SubjectCopy is not auto
implement for a type when the type is implemented Copy . Just use macro
impl_subject_copy_for_copy! to impl SubjectCopy for your type after
implemented Copy .
|