idsp 0.21.0

DSP algorithms for embedded, mostly integer math
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Build a value using a context
///
/// This is similar to the `Into` trait but allows lossy
/// (rounding, clamping, quantization) and non-value-preserving conversions.
/// The only semantic constraint is that the conversion is obvious and unambiguous.
pub trait Build<C> {
    /// The context of the convesion.
    ///
    /// E.g. units.
    type Context;

    /// Perform the conversion
    fn build(&self, ctx: &Self::Context) -> C;
}