Change stream
A Stream that only emits if the value is different.
Important
- The stream item is stored in the struct by Cloning so the stream Item must implement
Clone
- The comparison for the items is done via an equality check so the Item must implement
PartialEq
with itself
Example usage
- Add to your Cargo.toml file
[]
= "0.1.0"
- Import the
StreamChanged
trait and call.changed()
on an existing stream:
use StreamChanged;
use ;
async