#[repr(C)]pub struct u24(pub u8, pub u8, pub u8);
Expand description
- The tuple struct is little-endian
Tuple Fields§
§0: u8
§1: u8
§2: u8
Implementations§
Source§impl u24
impl u24
pub const MAX: u24
pub const MIN: u24
pub fn from_le_bytes(bytes: [u8; 3]) -> u24
pub fn from_be_bytes(bytes: [u8; 3]) -> u24
pub fn to_le_bytes(self) -> [u8; 3]
pub fn to_be_bytes(self) -> [u8; 3]
pub fn as_i128(self) -> i128
pub fn as_i64(self) -> i64
pub fn as_i32(self) -> i32
pub fn as_i16(self) -> i16
pub fn as_i8(self) -> i8
pub fn as_u128(self) -> u128
pub fn as_u64(self) -> u64
pub fn as_u32(self) -> u32
pub fn as_u16(self) -> u16
pub fn as_u8(self) -> u8
pub fn as_f32(self) -> f32
pub fn as_f64(self) -> f64
pub fn clamp(self, min: u24, max: u24) -> u24
Trait Implementations§
Source§impl AddAssign for u24
impl AddAssign for u24
Source§fn add_assign(&mut self, rhs: u24)
fn add_assign(&mut self, rhs: u24)
Performs the
+=
operation. Read moreSource§impl BitAndAssign for u24
impl BitAndAssign for u24
Source§fn bitand_assign(&mut self, rhs: u24)
fn bitand_assign(&mut self, rhs: u24)
Performs the
&=
operation. Read moreSource§impl BitOrAssign for u24
impl BitOrAssign for u24
Source§fn bitor_assign(&mut self, rhs: u24)
fn bitor_assign(&mut self, rhs: u24)
Performs the
|=
operation. Read moreSource§impl BitXorAssign for u24
impl BitXorAssign for u24
Source§fn bitxor_assign(&mut self, rhs: u24)
fn bitxor_assign(&mut self, rhs: u24)
Performs the
^=
operation. Read moreSource§impl DivAssign for u24
impl DivAssign for u24
Source§fn div_assign(&mut self, rhs: u24)
fn div_assign(&mut self, rhs: u24)
Performs the
/=
operation. Read moreSource§impl MulAssign for u24
impl MulAssign for u24
Source§fn mul_assign(&mut self, rhs: u24)
fn mul_assign(&mut self, rhs: u24)
Performs the
*=
operation. Read moreSource§impl Ord for u24
impl Ord for u24
Source§impl PartialOrd for u24
impl PartialOrd for u24
Source§impl RemAssign for u24
impl RemAssign for u24
Source§fn rem_assign(&mut self, rhs: u24)
fn rem_assign(&mut self, rhs: u24)
Performs the
%=
operation. Read moreSource§impl SampleFrom for u24
impl SampleFrom for u24
Source§fn to<S>(s: S) -> u24where
S: SampleType,
fn to<S>(s: S) -> u24where
S: SampleType,
The
to<S>
method, input any type of SampleType
value, then scale it to ImplFor
type.Source§fn as_<S>(s: S) -> u24where
S: SampleType,
fn as_<S>(s: S) -> u24where
S: SampleType,
The
as_<S>
method, input any type of SampleType
value, then cast it to ImplFor
type.Source§impl SampleType for u24
impl SampleType for u24
Source§fn new() -> u24
fn new() -> u24
Create a new sample, the value is the middle value of the range of the format.
Source§fn scale_from<T>(v: T) -> u24where
T: SampleType,
fn scale_from<T>(v: T) -> u24where
T: SampleType,
Scale a sample to this specified format.
Source§fn cast_from<T>(v: T) -> u24where
T: SampleType,
fn cast_from<T>(v: T) -> u24where
T: SampleType,
Cast a sample to this specified format.
Source§fn average_arr(arr: &[u24]) -> u24
fn average_arr(arr: &[u24]) -> u24
Get the average value from a sample array.
Source§fn clamp_to_i8(self) -> i8
fn clamp_to_i8(self) -> i8
Clamp to
i8
Source§fn clamp_to_i16(self) -> i16
fn clamp_to_i16(self) -> i16
Clamp to
i16
Source§fn clamp_to_i24(self) -> i24
fn clamp_to_i24(self) -> i24
Clamp to
i24
Source§fn clamp_to_i32(self) -> i32
fn clamp_to_i32(self) -> i32
Clamp to
i32
Source§fn clamp_to_i64(self) -> i64
fn clamp_to_i64(self) -> i64
Clamp to
i64
Source§fn clamp_to_u8(self) -> u8
fn clamp_to_u8(self) -> u8
Clamp to
u8
Source§fn clamp_to_u16(self) -> u16
fn clamp_to_u16(self) -> u16
Clamp to
u16
Source§fn clamp_to_u24(self) -> u24
fn clamp_to_u24(self) -> u24
Clamp to
u24
Source§fn clamp_to_u32(self) -> u32
fn clamp_to_u32(self) -> u32
Clamp to
u32
Source§fn clamp_to_u64(self) -> u64
fn clamp_to_u64(self) -> u64
Clamp to
u64
Source§fn clamp_to_f32(self) -> f32
fn clamp_to_f32(self) -> f32
Clamp to
f32
Source§fn clamp_to_f64(self) -> f64
fn clamp_to_f64(self) -> f64
Clamp to
f64
Source§fn clamp_to_i128(self) -> i128
fn clamp_to_i128(self) -> i128
Clamp to
i128
Source§fn clamp_to_u128(self) -> u128
fn clamp_to_u128(self) -> u128
Clamp to
u128
Source§fn to_longer(self) -> <u24 as SampleType>::Longer
fn to_longer(self) -> <u24 as SampleType>::Longer
Scale to a longer type, the longest type is
i128
or u128
Source§fn to_shorter(self) -> <u24 as SampleType>::Shorter
fn to_shorter(self) -> <u24 as SampleType>::Shorter
Scale to a shorter type, the shortest type is
i8
or u8
Source§fn as_longer(self) -> <u24 as SampleType>::Longer
fn as_longer(self) -> <u24 as SampleType>::Longer
Cast to a longer type, the longest type is
i128
or u128
Source§fn as_shorter(self) -> <u24 as SampleType>::Shorter
fn as_shorter(self) -> <u24 as SampleType>::Shorter
Cast to a shorter type, the shortest type is
i8
or u8
Source§fn is_unsigned() -> bool
fn is_unsigned() -> bool
Is this type an unsigned type?
Source§fn is_integer() -> bool
fn is_integer() -> bool
Is this type an integer type?
Source§fn to_signed(self) -> <u24 as SampleType>::Signed
fn to_signed(self) -> <u24 as SampleType>::Signed
Convert to a signed number type. No effects to
f32
and f64
Source§fn to_unsigned(self) -> <u24 as SampleType>::Unsigned
fn to_unsigned(self) -> <u24 as SampleType>::Unsigned
Convert to an unsigned number type. No effects to
f32
and f64
Source§fn sin<S>(self) -> Swhere
S: SampleType,
fn sin<S>(self) -> Swhere
S: SampleType,
Sine wave generator Read more
Source§fn cos<S>(self) -> Swhere
S: SampleType,
fn cos<S>(self) -> Swhere
S: SampleType,
Cosine wave generator Read more
Source§impl ShlAssign for u24
impl ShlAssign for u24
Source§fn shl_assign(&mut self, rhs: u24)
fn shl_assign(&mut self, rhs: u24)
Performs the
<<=
operation. Read moreSource§impl ShrAssign for u24
impl ShrAssign for u24
Source§fn shr_assign(&mut self, rhs: u24)
fn shr_assign(&mut self, rhs: u24)
Performs the
>>=
operation. Read moreSource§impl SubAssign for u24
impl SubAssign for u24
Source§fn sub_assign(&mut self, rhs: u24)
fn sub_assign(&mut self, rhs: u24)
Performs the
-=
operation. Read moreimpl Copy for u24
impl Eq for u24
impl StructuralPartialEq for u24
Auto Trait Implementations§
impl Freeze for u24
impl RefUnwindSafe for u24
impl Send for u24
impl Sync for u24
impl Unpin for u24
impl UnwindSafe for u24
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more