Skip to main content

Sample

Trait Sample 

Source
pub trait Sample:
    Sealed
    + Copy
    + PartialOrd
    + Debug
    + Display
    + Add<Output = Self>
    + AddAssign
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + Neg<Output = Self> {
    const ZERO: Self;
    const ONE: Self;
    const TWO: Self;
    const PI: Self;

    // Required method
    fn clamp(self, min: Self, max: Self) -> Self;
}
Expand description

A sample type LowpassFilter can operate on: f32 or f64.

This trait is sealed and cannot be implemented outside of this crate.

Required Associated Constants§

Source

const ZERO: Self

0.0

Source

const ONE: Self

1.0

Source

const TWO: Self

2.0

Source

const PI: Self

Archimedes’ constant (π).

Required Methods§

Source

fn clamp(self, min: Self, max: Self) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Sample for f32

Source§

const ZERO: Self = 0.0

Source§

const ONE: Self = 1.0

Source§

const TWO: Self = 2.0

Source§

const PI: Self = core::f32::consts::PI

Source§

fn clamp(self, min: Self, max: Self) -> Self

Source§

impl Sample for f64

Source§

const ZERO: Self = 0.0

Source§

const ONE: Self = 1.0

Source§

const TWO: Self = 2.0

Source§

const PI: Self = core::f64::consts::PI

Source§

fn clamp(self, min: Self, max: Self) -> Self

Implementors§