Build

Trait Build 

Source
pub trait Build<C> {
    type Context;

    // Required method
    fn build(&self, ctx: &Self::Context) -> C;
}
Expand description

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.

Required Associated Types§

Source

type Context

The context of the convesion.

E.g. units.

Required Methods§

Source

fn build(&self, ctx: &Self::Context) -> C

Perform the conversion

Implementors§

Source§

impl<C, T> Build<Biquad<C>> for Builder<T>
where Self: Build<[C; 5]>, Biquad<C>: From<[C; 5]>,

Source§

impl<T, C> Build<[C; 5]> for Builder<T>
where C: 'static + Copy + SubAssign + AddAssign, T: Float + AsPrimitive<C>,

Source§

impl<T, Y, C> Build<BiquadClamp<C, Y>> for Pid<T>
where Y: 'static + Copy + Mul<C, Output = Y> + Div<C, Output = Y>, C: Add<Output = C> + Copy, T: AsPrimitive<Y> + Float, BiquadClamp<C, Y>: From<[C; 5]>, Builder<T>: Build<[C; 5], Context = T>,