2 unstable releases
0.2.0 | Jun 26, 2022 |
---|---|
0.1.0 | Jun 25, 2022 |
#2886 in Rust patterns
6KB
114 lines
Noticeable
This is a simple crate that contains types to support the Observer pattern in Rust. For now, the types are safe to send across threads, but a single threaded version will likely be added eventually to remove the Send bound in callbacks.
Observable
This type allows the notification of Subscribers that an event has occured, who then each handle their callbacks for that event.
Subscriber
A handle used to subscribe to an Observables events. When the Subscriber goes out of scope, its callback will stop being called upon new events.
lib.rs
:
A crate for implementing the Observer pattern i.e. sending events from Observables to Subscribers.