Write the code for a library in Rust, using the observer pattern based on the library RxJS