rx_rust/subject/subject_ext.rs
1use super::{Subject, subject_observable::SubjectObservable};
2
3pub trait SubjectExt<'or, 'sub, T, E>: Sized {
4 // Convert a subject into an observable, erase the observer behavior of the subject.
5 fn into_observable(self) -> SubjectObservable<Self> {
6 SubjectObservable::new(self)
7 }
8}
9
10impl<'or, 'sub, T, E, S> SubjectExt<'or, 'sub, T, E> for S where S: Subject<'or, 'sub, T, E> {}