Trait Sample

Source
pub trait Sample:
    Copy
    + CoerceFrom<usize>
    + CoerceFrom<f64>
    + CoerceFrom<f32>
    + FftNum
    + Mul
    + Div
    + Add
    + Sub
    + MulAssign
    + RemAssign
    + DivAssign
    + SubAssign
    + AddAssign
    + AvxSample
    + SseSample
    + NeonSample
    + Send {
    const PI: Self;

    // Required methods
    fn sin(self) -> Self;
    fn cos(self) -> Self;

    // Provided method
    fn coerce<T>(value: T) -> Self
       where Self: CoerceFrom<T> { ... }
}
Expand description

The trait governing a single sample.

There are two types which implements this trait so far:

Required Associated Constants§

Source

const PI: Self

Required Methods§

Source

fn sin(self) -> Self

Calculate the sine of self.

Source

fn cos(self) -> Self

Calculate the cosine of self.

Provided Methods§

Source

fn coerce<T>(value: T) -> Self
where Self: CoerceFrom<T>,

Coerce value into the current type.

Coercions are governed through the private CoerceFrom trait.

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§

Source§

impl Sample for f32

Source§

const PI: f32 = 3.14159274f32

Source§

fn sin(self) -> f32

Source§

fn cos(self) -> f32

Source§

impl Sample for f64

Source§

const PI: f64 = 3.1415926535897931f64

Source§

fn sin(self) -> f64

Source§

fn cos(self) -> f64

Implementors§