vecdb 0.10.2

High-performance mutable persistent vectors built on rawdb
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::DeltaOp;

/// Delta change: `source[h] - source[start]` via f64, allowing cross-type (unsigned → signed).
#[derive(Clone, Copy)]
pub struct DeltaChange;

impl<S, C> DeltaOp<S, C> for DeltaChange
where
    S: Into<f64>,
    C: From<f64>,
{
    #[inline]
    fn combine(current: S, ago: S, _count: usize) -> C {
        C::from(Into::<f64>::into(current) - Into::<f64>::into(ago))
    }
}