Struct sample::types::i48::I48 [] [src]

pub struct I48(_);

Methods

impl I48
[src]

fn new(val: i64) -> Option<Self>

Construct a new sample if the given value is within range.

Returns None if val is out of range.

fn new_unchecked(s: i64) -> Self

Constructs a new sample without checking for overflowing.

This should only be used if the user can guarantee the sample will be within range and they require the extra performance.

If this function is used, the sample crate can't guarantee that the returned sample or any interacting samples will remain within their MIN and MAX bounds.

fn inner(self) -> i64

Return the internal value used to represent the sample type.

Trait Implementations

impl FromSample<i8> for I48
[src]

fn from_sample_(s: i8) -> Self

impl FromSample<i16> for I48
[src]

fn from_sample_(s: i16) -> Self

impl FromSample<I24> for I48
[src]

fn from_sample_(s: I24) -> Self

impl FromSample<i32> for I48
[src]

fn from_sample_(s: i32) -> Self

impl FromSample<i64> for I48
[src]

fn from_sample_(s: i64) -> Self

impl FromSample<u8> for I48
[src]

fn from_sample_(s: u8) -> Self

impl FromSample<u16> for I48
[src]

fn from_sample_(s: u16) -> Self

impl FromSample<U24> for I48
[src]

fn from_sample_(s: U24) -> Self

impl FromSample<u32> for I48
[src]

fn from_sample_(s: u32) -> Self

impl FromSample<U48> for I48
[src]

fn from_sample_(s: U48) -> Self

impl FromSample<u64> for I48
[src]

fn from_sample_(s: u64) -> Self

impl FromSample<f32> for I48
[src]

fn from_sample_(s: f32) -> Self

impl FromSample<f64> for I48
[src]

fn from_sample_(s: f64) -> Self

impl From<i64> for I48
[src]

fn from(val: i64) -> Self

Performs the conversion.

impl Add<I48> for I48
[src]

type Output = I48

The resulting type after applying the + operator

fn add(self, other: Self) -> Self

The method for the + operator

impl Sub<I48> for I48
[src]

type Output = I48

The resulting type after applying the - operator

fn sub(self, other: Self) -> Self

The method for the - operator

impl Mul<I48> for I48
[src]

type Output = I48

The resulting type after applying the * operator

fn mul(self, other: Self) -> Self

The method for the * operator

impl Div<I48> for I48
[src]

type Output = I48

The resulting type after applying the / operator

fn div(self, other: Self) -> Self

The method for the / operator

impl Not for I48
[src]

type Output = I48

The resulting type after applying the ! operator

fn not(self) -> I48

The method for the unary ! operator

impl Rem<I48> for I48
[src]

type Output = I48

The resulting type after applying the % operator

fn rem(self, other: Self) -> Self

The method for the % operator

impl Shl<I48> for I48
[src]

type Output = I48

The resulting type after applying the << operator

fn shl(self, other: Self) -> Self

The method for the << operator

impl Shr<I48> for I48
[src]

type Output = I48

The resulting type after applying the >> operator

fn shr(self, other: Self) -> Self

The method for the >> operator

impl BitAnd<I48> for I48
[src]

type Output = I48

The resulting type after applying the & operator

fn bitand(self, other: Self) -> Self

The method for the & operator

impl BitOr<I48> for I48
[src]

type Output = I48

The resulting type after applying the | operator

fn bitor(self, other: Self) -> Self

The method for the | operator

impl BitXor<I48> for I48
[src]

type Output = I48

The resulting type after applying the ^ operator

fn bitxor(self, other: Self) -> Self

The method for the ^ operator

impl From<i8> for I48
[src]

fn from(other: i8) -> Self

Performs the conversion.

impl From<i16> for I48
[src]

fn from(other: i16) -> Self

Performs the conversion.

impl From<I20> for I48
[src]

fn from(other: I20) -> Self

Performs the conversion.

impl From<I24> for I48
[src]

fn from(other: I24) -> Self

Performs the conversion.

impl From<i32> for I48
[src]

fn from(other: i32) -> Self

Performs the conversion.

impl From<u8> for I48
[src]

fn from(other: u8) -> Self

Performs the conversion.

impl From<u16> for I48
[src]

fn from(other: u16) -> Self

Performs the conversion.

impl From<U20> for I48
[src]

fn from(other: U20) -> Self

Performs the conversion.

impl From<U24> for I48
[src]

fn from(other: U24) -> Self

Performs the conversion.

impl From<u32> for I48
[src]

fn from(other: u32) -> Self

Performs the conversion.

impl Neg for I48
[src]

type Output = I48

The resulting type after applying the - operator

fn neg(self) -> I48

The method for the unary - operator

impl Sample for I48
[src]

type Signed = I48

When summing two samples of a signal together, it is necessary for both samples to be represented in some signed format. This associated Addition type represents the format to which Self should be converted for optimal Addition performance. Read more

type Float = f64

When multiplying two samples of a signal together, it is necessary for both samples to be represented in some signed, floating-point format. This associated Multiplication type represents the format to which Self should be converted for optimal Multiplication performance. Read more

fn equilibrium() -> Self

The equilibrium value for the wave that this Sample type represents. This is normally the value that is equal distance from both the min and max ranges of the sample. Read more

fn identity() -> Self::Float

The multiplicative identity of the signal. Read more

fn to_sample<S>(self) -> S where Self: ToSample<S>

Convert self to any type that implements FromSample<Self>. Read more

fn from_sample<S>(s: S) -> Self where Self: FromSample<S>

Create a Self from any type that implements ToSample<Self>. Read more

fn to_signed_sample(self) -> Self::Signed

Converts self to the equivalent Sample in the associated Signed format. Read more

fn to_float_sample(self) -> Self::Float

Converts self to the equivalent Sample in the associated Float format. Read more

fn add_amp(self, amp: Self::Signed) -> Self

Adds (or "offsets") the amplitude of the Sample by the given signed amplitude. Read more

fn mul_amp(self, amp: Self::Float) -> Self

Multiplies (or "scales") the amplitude of the Sample by the given float amplitude. Read more

impl SignedSample for I48
[src]

Derived Implementations

impl Default for I48
[src]

fn default() -> I48

Returns the "default value" for a type. Read more

impl Ord for I48
[src]

fn cmp(&self, __arg_0: &I48) -> Ordering

This method returns an Ordering between self and other. Read more

impl PartialOrd for I48
[src]

fn partial_cmp(&self, __arg_0: &I48) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, __arg_0: &I48) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, __arg_0: &I48) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, __arg_0: &I48) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, __arg_0: &I48) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Eq for I48
[src]

impl PartialEq for I48
[src]

fn eq(&self, __arg_0: &I48) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &I48) -> bool

This method tests for !=.

impl Debug for I48
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for I48
[src]

fn clone(&self) -> I48

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for I48
[src]