Trait flac::Sample [] [src]

pub trait Sample: PartialEq + Eq + Sized + Clone + Copy + Add<Output = Self> + AddAssign + BitAnd<Self, Output = Self> + BitOr<Self, Output = Self> + Mul<Output = Self> + Shl<u32, Output = Self> + ShlAssign<u32> + Shr<u32, Output = Self> + Shr<i8, Output = Self> + Shr<i32, Output = Self> + Sub<Output = Self> {
    type Normal;
    fn size() -> usize;
    fn size_extended() -> usize;
    fn to_normal(sample: Self) -> Option<Self::Normal>;
    fn from_i8(sample: i8) -> Self;
    fn from_i16(sample: i16) -> Self;
    fn from_i32(sample: i32) -> Option<Self>;
    fn from_i32_lossy(sample: i32) -> Self;
}

An abstraction trait for keeping different sized integers.

Associated Types

The normal size for the current a Sample.

Required Methods

The size, in bits, for the Sample::Normal.

The size, in bits, for the Sample.

Convert the extended Sample to the normal.

Convert an i8 into a Sample.

Convert an i16 into a Sample.

Convert an i32 into a Sample.

With Sample sometimes being smaller than a i32, there is a chance for this function to return an incorrect number. So when the number is larger of smaller than the current Sample, it returns None otherwise Some(sample).

Convert an i32 into a Sample.

Implementors