Trait SampleType

Source
pub trait SampleType: SampleFrom {
    type ImplFor;
    type Longer;
    type Shorter;
    type Signed;
    type Unsigned;

    const MIDNUM: Self;
    const TYPE_NAME: &'static str;
Show 66 methods // Required methods fn new() -> Self; fn zero() -> Self; fn scale_from<T>(v: T) -> Self where T: SampleType; fn cast_from<T>(v: T) -> Self where T: SampleType; fn average(s1: Self, s2: Self) -> Self; fn average_arr(arr: &[Self]) -> Self; fn to_i8(self) -> i8; fn to_i16(self) -> i16; fn to_i24(self) -> i24; fn to_i32(self) -> i32; fn to_i64(self) -> i64; fn to_u8(self) -> u8; fn to_u16(self) -> u16; fn to_u24(self) -> u24; fn to_u32(self) -> u32; fn to_u64(self) -> u64; fn to_f32(self) -> f32; fn to_f64(self) -> f64; fn to_i128(self) -> i128; fn to_u128(self) -> u128; fn as_i8(self) -> i8; fn as_i16(self) -> i16; fn as_i24(self) -> i24; fn as_i32(self) -> i32; fn as_i64(self) -> i64; fn as_u8(self) -> u8; fn as_u16(self) -> u16; fn as_u24(self) -> u24; fn as_u32(self) -> u32; fn as_u64(self) -> u64; fn as_f32(self) -> f32; fn as_f64(self) -> f64; fn as_i128(self) -> i128; fn as_u128(self) -> u128; fn clamp_to_i8(self) -> i8; fn clamp_to_i16(self) -> i16; fn clamp_to_i24(self) -> i24; fn clamp_to_i32(self) -> i32; fn clamp_to_i64(self) -> i64; fn clamp_to_u8(self) -> u8; fn clamp_to_u16(self) -> u16; fn clamp_to_u24(self) -> u24; fn clamp_to_u32(self) -> u32; fn clamp_to_u64(self) -> u64; fn clamp_to_f32(self) -> f32; fn clamp_to_f64(self) -> f64; fn clamp_to_i128(self) -> i128; fn clamp_to_u128(self) -> u128; fn to_longer(self) -> Self::Longer; fn to_shorter(self) -> Self::Shorter; fn as_longer(self) -> Self::Longer; fn as_shorter(self) -> Self::Shorter; fn is_signed() -> bool; fn is_unsigned() -> bool; fn is_integer() -> bool; fn is_float() -> bool; fn to_signed(self) -> Self::Signed; fn to_unsigned(self) -> Self::Unsigned; fn sin<S>(self) -> S where S: SampleType; fn cos<S>(self) -> S where S: SampleType; fn interpolate(self, target: Self, s: f64) -> Self; fn read_le<T>(r: &mut T) -> Result<Self, Error> where T: Read + ?Sized; fn read_be<T>(r: &mut T) -> Result<Self, Error> where T: Read + ?Sized; fn write_le<T>(self, w: &mut T) -> Result<(), Error> where T: Write + ?Sized; fn write_be<T>(self, w: &mut T) -> Result<(), Error> where T: Write + ?Sized; // Provided method fn sizeof(self) -> usize { ... }
}
Expand description
  • The SampleType for audio processing.
  • The to_*() methods are for scaling the sample to the another format.
  • The as_*() methods are for casting the sample to the another format.

Required Associated Constants§

Source

const MIDNUM: Self

The middle number, e.g. for u16, the middle number is 32768.

Source

const TYPE_NAME: &'static str

The type name, to avoid using std::any::type_name

Required Associated Types§

Source

type ImplFor

The type we are implementating for

Source

type Longer

The longer type, e.g. for i8, the longer type is i16

Source

type Shorter

The shorter type, e.g. for i16, the shorter type is i8

Source

type Signed

The signed type, e.g. for u32, the signed type is i32.

Source

type Unsigned

The Unsigned type, e.g. for i32, the unsigned type is u32.

Required Methods§

Source

fn new() -> Self

Create a new sample, the value is the middle value of the range of the format.

Source

fn zero() -> Self

Create a new sample, the value is zero.

Source

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Scale a sample to this specified format.

Source

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Cast a sample to this specified format.

Source

fn average(s1: Self, s2: Self) -> Self

Get the average value of two samples.

Source

fn average_arr(arr: &[Self]) -> Self

Get the average value from a sample array.

Source

fn to_i8(self) -> i8

Scale to i8 range

Source

fn to_i16(self) -> i16

Scale to i16 range

Source

fn to_i24(self) -> i24

Scale to i24 range

Source

fn to_i32(self) -> i32

Scale to i32 range

Source

fn to_i64(self) -> i64

Scale to i64 range

Source

fn to_u8(self) -> u8

Scale to u8 range

Source

fn to_u16(self) -> u16

Scale to u16 range

Source

fn to_u24(self) -> u24

Scale to u24 range

Source

fn to_u32(self) -> u32

Scale to u32 range

Source

fn to_u64(self) -> u64

Scale to u64 range

Source

fn to_f32(self) -> f32

Scale to [-1.0, 1.0] range

Source

fn to_f64(self) -> f64

Scale to [-1.0, 1.0] range

Source

fn to_i128(self) -> i128

Scale to i128 range

Source

fn to_u128(self) -> u128

Scale to u128 range

Source

fn as_i8(self) -> i8

Cast to i8

Source

fn as_i16(self) -> i16

Cast to i16

Source

fn as_i24(self) -> i24

Cast to i24

Source

fn as_i32(self) -> i32

Cast to i32

Source

fn as_i64(self) -> i64

Cast to i64

Source

fn as_u8(self) -> u8

Cast to u8

Source

fn as_u16(self) -> u16

Cast to u16

Source

fn as_u24(self) -> u24

Cast to u24

Source

fn as_u32(self) -> u32

Cast to u32

Source

fn as_u64(self) -> u64

Cast to u64

Source

fn as_f32(self) -> f32

Cast to f32

Source

fn as_f64(self) -> f64

Cast to f64

Source

fn as_i128(self) -> i128

Cast to i128

Source

fn as_u128(self) -> u128

Cast to u128

Source

fn clamp_to_i8(self) -> i8

Clamp to i8

Source

fn clamp_to_i16(self) -> i16

Clamp to i16

Source

fn clamp_to_i24(self) -> i24

Clamp to i24

Source

fn clamp_to_i32(self) -> i32

Clamp to i32

Source

fn clamp_to_i64(self) -> i64

Clamp to i64

Source

fn clamp_to_u8(self) -> u8

Clamp to u8

Source

fn clamp_to_u16(self) -> u16

Clamp to u16

Source

fn clamp_to_u24(self) -> u24

Clamp to u24

Source

fn clamp_to_u32(self) -> u32

Clamp to u32

Source

fn clamp_to_u64(self) -> u64

Clamp to u64

Source

fn clamp_to_f32(self) -> f32

Clamp to f32

Source

fn clamp_to_f64(self) -> f64

Clamp to f64

Source

fn clamp_to_i128(self) -> i128

Clamp to i128

Source

fn clamp_to_u128(self) -> u128

Clamp to u128

Source

fn to_longer(self) -> Self::Longer

Scale to a longer type, the longest type is i128 or u128

Source

fn to_shorter(self) -> Self::Shorter

Scale to a shorter type, the shortest type is i8 or u8

Source

fn as_longer(self) -> Self::Longer

Cast to a longer type, the longest type is i128 or u128

Source

fn as_shorter(self) -> Self::Shorter

Cast to a shorter type, the shortest type is i8 or u8

Source

fn is_signed() -> bool

Is this type a signed type?

Source

fn is_unsigned() -> bool

Is this type an unsigned type?

Source

fn is_integer() -> bool

Is this type an integer type?

Source

fn is_float() -> bool

Is this type an IEEE 754 floating point number type?

Source

fn to_signed(self) -> Self::Signed

Convert to a signed number type. No effects to f32 and f64

Source

fn to_unsigned(self) -> Self::Unsigned

Convert to an unsigned number type. No effects to f32 and f64

Source

fn sin<S>(self) -> S
where S: SampleType,

Sine wave generator

  • The input x doesn’t need to be related to PI.
  • e.g. The type is i8, the value is -128, then you will get sin(-PI).
  • e.g. The type is u8, the value is 0, then you will get sin(-PI) too.
Source

fn cos<S>(self) -> S
where S: SampleType,

Cosine wave generator

  • The input x doesn’t need to be related to PI.
  • e.g. The type is i8, the value is -128, then you will get cos(-PI).
  • e.g. The type is u8, the value is 0, then you will get cos(-PI) too.
Source

fn interpolate(self, target: Self, s: f64) -> Self

interpolate between self to target by s

Source

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Read from a reader by little-endian

Source

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Read from a reader by big-endian

Source

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Write to a writer by little-endian

Source

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Write to a writer by big-endian

Provided Methods§

Source

fn sizeof(self) -> usize

Get the size of the sample in bytes

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 SampleType for f32

Source§

const MIDNUM: f32 = 0f32

Source§

const TYPE_NAME: &str = "f32"

Source§

type ImplFor = f32

Source§

type Longer = f64

Source§

type Shorter = f32

Source§

type Signed = f32

Source§

type Unsigned = f32

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Source§

impl SampleType for f64

Source§

const MIDNUM: f64 = 0f64

Source§

const TYPE_NAME: &str = "f64"

Source§

type ImplFor = f64

Source§

type Longer = f64

Source§

type Shorter = f32

Source§

type Signed = f64

Source§

type Unsigned = f64

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Source§

impl SampleType for i8

Source§

const MIDNUM: i8 = 0i8

Source§

const TYPE_NAME: &str = "i8"

Source§

type ImplFor = i8

Source§

type Longer = i16

Source§

type Shorter = i8

Source§

type Signed = i8

Source§

type Unsigned = u8

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Source§

impl SampleType for i16

Source§

const MIDNUM: i16 = 0i16

Source§

const TYPE_NAME: &str = "i16"

Source§

type ImplFor = i16

Source§

type Longer = i24

Source§

type Shorter = i8

Source§

type Signed = i16

Source§

type Unsigned = u16

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Source§

impl SampleType for i32

Source§

const MIDNUM: i32 = 0i32

Source§

const TYPE_NAME: &str = "i32"

Source§

type ImplFor = i32

Source§

type Longer = i64

Source§

type Shorter = i24

Source§

type Signed = i32

Source§

type Unsigned = u32

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Source§

impl SampleType for i64

Source§

const MIDNUM: i64 = 0i64

Source§

const TYPE_NAME: &str = "i64"

Source§

type ImplFor = i64

Source§

type Longer = i128

Source§

type Shorter = i32

Source§

type Signed = i64

Source§

type Unsigned = u64

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Source§

impl SampleType for i128

Source§

const MIDNUM: i128 = 0i128

Source§

const TYPE_NAME: &str = "i128"

Source§

type ImplFor = i128

Source§

type Longer = i128

Source§

type Shorter = i64

Source§

type Signed = i128

Source§

type Unsigned = u128

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Source§

impl SampleType for u8

Source§

const MIDNUM: u8 = 128u8

Source§

const TYPE_NAME: &str = "u8"

Source§

type ImplFor = u8

Source§

type Longer = u16

Source§

type Shorter = u8

Source§

type Signed = i8

Source§

type Unsigned = u8

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Source§

impl SampleType for u16

Source§

const MIDNUM: u16 = 32_768u16

Source§

const TYPE_NAME: &str = "u16"

Source§

type ImplFor = u16

Source§

type Longer = u24

Source§

type Shorter = u8

Source§

type Signed = i16

Source§

type Unsigned = u16

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Source§

impl SampleType for u32

Source§

const MIDNUM: u32 = 2_147_483_648u32

Source§

const TYPE_NAME: &str = "u32"

Source§

type ImplFor = u32

Source§

type Longer = u64

Source§

type Shorter = u24

Source§

type Signed = i32

Source§

type Unsigned = u32

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Source§

impl SampleType for u64

Source§

const MIDNUM: u64 = 9_223_372_036_854_775_808u64

Source§

const TYPE_NAME: &str = "u64"

Source§

type ImplFor = u64

Source§

type Longer = u128

Source§

type Shorter = u32

Source§

type Signed = i64

Source§

type Unsigned = u64

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Source§

impl SampleType for u128

Source§

const MIDNUM: u128 = 170_141_183_460_469_231_731_687_303_715_884_105_728u128

Source§

const TYPE_NAME: &str = "u128"

Source§

type ImplFor = u128

Source§

type Longer = u128

Source§

type Shorter = u64

Source§

type Signed = i128

Source§

type Unsigned = u128

Source§

fn new() -> Self

Source§

fn zero() -> Self

Source§

fn scale_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn cast_from<T>(v: T) -> Self
where T: SampleType,

Source§

fn average(s1: Self, s2: Self) -> Self

Source§

fn average_arr(arr: &[Self]) -> Self

Source§

fn to_i8(self) -> i8

Source§

fn to_i16(self) -> i16

Source§

fn to_i24(self) -> i24

Source§

fn to_i32(self) -> i32

Source§

fn to_i64(self) -> i64

Source§

fn to_u8(self) -> u8

Source§

fn to_u16(self) -> u16

Source§

fn to_u24(self) -> u24

Source§

fn to_u32(self) -> u32

Source§

fn to_u64(self) -> u64

Source§

fn to_f32(self) -> f32

Source§

fn to_f64(self) -> f64

Source§

fn to_i128(self) -> i128

Source§

fn to_u128(self) -> u128

Source§

fn as_i8(self) -> i8

Source§

fn as_i16(self) -> i16

Source§

fn as_i24(self) -> i24

Source§

fn as_i32(self) -> i32

Source§

fn as_i64(self) -> i64

Source§

fn as_u8(self) -> u8

Source§

fn as_u16(self) -> u16

Source§

fn as_u24(self) -> u24

Source§

fn as_u32(self) -> u32

Source§

fn as_u64(self) -> u64

Source§

fn as_f32(self) -> f32

Source§

fn as_f64(self) -> f64

Source§

fn as_i128(self) -> i128

Source§

fn as_u128(self) -> u128

Source§

fn clamp_to_i8(self) -> i8

Source§

fn clamp_to_i16(self) -> i16

Source§

fn clamp_to_i24(self) -> i24

Source§

fn clamp_to_i32(self) -> i32

Source§

fn clamp_to_i64(self) -> i64

Source§

fn clamp_to_u8(self) -> u8

Source§

fn clamp_to_u16(self) -> u16

Source§

fn clamp_to_u24(self) -> u24

Source§

fn clamp_to_u32(self) -> u32

Source§

fn clamp_to_u64(self) -> u64

Source§

fn clamp_to_f32(self) -> f32

Source§

fn clamp_to_f64(self) -> f64

Source§

fn clamp_to_i128(self) -> i128

Source§

fn clamp_to_u128(self) -> u128

Source§

fn to_longer(self) -> Self::Longer

Source§

fn to_shorter(self) -> Self::Shorter

Source§

fn as_longer(self) -> Self::Longer

Source§

fn as_shorter(self) -> Self::Shorter

Source§

fn is_signed() -> bool

Source§

fn is_unsigned() -> bool

Source§

fn is_integer() -> bool

Source§

fn is_float() -> bool

Source§

fn to_signed(self) -> Self::Signed

Source§

fn to_unsigned(self) -> Self::Unsigned

Source§

fn read_le<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn read_be<T>(r: &mut T) -> Result<Self, Error>
where T: Read + ?Sized,

Source§

fn write_le<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn write_be<T>(self, w: &mut T) -> Result<(), Error>
where T: Write + ?Sized,

Source§

fn sin<S>(self) -> S
where S: SampleType,

Source§

fn cos<S>(self) -> S
where S: SampleType,

Source§

fn interpolate(self, target: Self, s: f64) -> Self

Implementors§