SignalType

Trait SignalType 

pub trait SignalType:
    Copy
    + Clone
    + Debug
    + PartialEq
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + Default
    + Send
    + Sync
    + 'static {
    // Required methods
    fn zero() -> Self;
    fn one() -> Self;
    fn from_f64(v: f64) -> Self;
    fn to_f64(self) -> f64;
}
Expand description

Trait for numeric types that can be used in signal processing.

The 'static bound lets numeric kernels (e.g. the bulk MODWT convolution in transform::simd) specialize on the concrete element type via TypeId. All real SignalType impls (f32, f64) satisfy it trivially.

Required Methods§

fn zero() -> Self

fn one() -> Self

fn from_f64(v: f64) -> Self

fn to_f64(self) -> f64

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl SignalType for f32

§

fn zero() -> Self

§

fn one() -> Self

§

fn from_f64(v: f64) -> Self

§

fn to_f64(self) -> f64

§

impl SignalType for f64

§

fn zero() -> Self

§

fn one() -> Self

§

fn from_f64(v: f64) -> Self

§

fn to_f64(self) -> f64

Implementors§