pub struct U24BE<const N: usize>(/* private fields */);Expand description
24 bit unsigned integer, big endian. 24 bits stored packed as as 3 bytes or padded as 4 bytes.
Trait Implementations§
Source§impl BytesSample for U24BE<3>
24 bit unsigned integer, big endian, stored as 3 bytes without padding.
impl BytesSample for U24BE<3>
24 bit unsigned integer, big endian, stored as 3 bytes without padding.
Source§const BYTES_PER_SAMPLE: usize = 3usize
const BYTES_PER_SAMPLE: usize = 3usize
The number of bytes making up each sample value.
Source§type NumericType = u32
type NumericType = u32
The closest matching numeric type.
Source§fn from_slice(bytes: &[u8]) -> Self
fn from_slice(bytes: &[u8]) -> Self
Create a new ByteSample from a slice of raw bytes.
The slice length must be at least the number of bytes
for a sample value.
Source§fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Return the raw bytes as a mutable slice.
Source§fn to_number(&self) -> Self::NumericType
fn to_number(&self) -> Self::NumericType
Convert the raw bytes to a numerical value.
Source§fn from_number(value: Self::NumericType) -> Self
fn from_number(value: Self::NumericType) -> Self
Convert a numerical value to raw bytes.
Source§impl BytesSample for U24BE<4>
24 bit unsigned integer, big endian, stored as 4 bytes. The data is in the lower 3 bytes and the most significant byte is padding.
impl BytesSample for U24BE<4>
24 bit unsigned integer, big endian, stored as 4 bytes. The data is in the lower 3 bytes and the most significant byte is padding.
Source§const BYTES_PER_SAMPLE: usize = 4usize
const BYTES_PER_SAMPLE: usize = 4usize
The number of bytes making up each sample value.
Source§type NumericType = u32
type NumericType = u32
The closest matching numeric type.
Source§fn from_slice(bytes: &[u8]) -> Self
fn from_slice(bytes: &[u8]) -> Self
Create a new ByteSample from a slice of raw bytes.
The slice length must be at least the number of bytes
for a sample value.
Source§fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Return the raw bytes as a mutable slice.
Source§fn to_number(&self) -> Self::NumericType
fn to_number(&self) -> Self::NumericType
Convert the raw bytes to a numerical value.
Source§fn from_number(value: Self::NumericType) -> Self
fn from_number(value: Self::NumericType) -> Self
Convert a numerical value to raw bytes.
impl<const N: usize> Copy for U24BE<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for U24BE<N>
impl<const N: usize> RefUnwindSafe for U24BE<N>
impl<const N: usize> Send for U24BE<N>
impl<const N: usize> Sync for U24BE<N>
impl<const N: usize> Unpin for U24BE<N>
impl<const N: usize> UnwindSafe for U24BE<N>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<V> RawSample for V
impl<V> RawSample for V
Source§fn to_scaled_float<T>(&self) -> Twhere
T: Float,
fn to_scaled_float<T>(&self) -> Twhere
T: Float,
Convert the sample value to a float in the range -1.0 .. +1.0.
Source§fn from_scaled_float<T>(value: T) -> ConversionResult<V>where
T: Float,
fn from_scaled_float<T>(value: T) -> ConversionResult<V>where
T: Float,
Convert a float in the range -1.0 .. +1.0 to a sample value.
Values outside the allowed range are clipped to the nearest limit.