running_buffer 0.1.1

data types for keeping track of changing values, allowing analysis in trends and histories.
Documentation
# running_buffer.rs
Data types for variables of which you want to monitor their changing state.

# History
a `History` keeps track of how a value changes over time.
Its focus is on giving the ability to compare recent history with longer-duration history.
It saves `N_MOST_RECENT` values, and in addition keeps cumulative and total amount of all previous value as well.
This way both recent and total historical values can be assessed and compared.

```rust

        let mut s = History::<u32, u64, 2>::new();
        assert_eq!(s.most_recent(), None);
        assert_eq!(s.total_tests, 0);
        assert_eq!(s.total_historic, 0);

        s.push(100);
        assert_eq!(s.most_recent().unwrap(), &100);
        assert_eq!(s.total_tests, 1);
        assert_eq!(s.total_historic, 100);

        s.push(101);
        assert_eq!(s.most_recent().unwrap(), &101);
        assert_eq!(s.previous().unwrap(), &100);
        assert_eq!(s.total_tests, 2);
        assert_eq!(s.total_historic, 201);

        // Only keeps 2 most recent, other only as cumulative.
        s.push(102);
        assert_eq!(s.most_recent().unwrap(), &102);
        assert_eq!(s.previous().unwrap(), &101);
        assert_eq!(s.n_ago(2), None);
        assert_eq!(s.total_tests, 3);
        assert_eq!(s.total_historic, 303);
```

## the `CUM` type.
As keeping a very long history might run out of bounds of the variable type `T`, a separate type `CUM` is used to store long-term cumulative data.
The only requirement is for `T` to be transformable into `CUM`.
For example, I want to record instances of `u32`. If I record `history.pushed(4_294_967_200).pushed(500000)`, `u32` would overflow.
By taking the `CUM` type as `u64`, you can keep the size of the `History` smaller than if you were to store all instances as `u64`, while still having an accurate cumulative number.