pub struct U8(/* private fields */);Expand description
8 bit unsigned integer. Stored as 1 byte. A single byte has no byte order, so there are no little endian and big endian variants.
Trait Implementations§
Source§impl BytesSample for U8
impl BytesSample for U8
Source§const BYTES_PER_SAMPLE: usize
const BYTES_PER_SAMPLE: usize
The number of bytes making up each sample value.
Source§type NumericType = u8
type NumericType = u8
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 Copy for U8
Auto Trait Implementations§
impl Freeze for U8
impl RefUnwindSafe for U8
impl Send for U8
impl Sync for U8
impl Unpin for U8
impl UnsafeUnpin for U8
impl UnwindSafe for U8
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: FloatCore + ToPrimitive,
fn to_scaled_float<T>(&self) -> Twhere
T: FloatCore + ToPrimitive,
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: FloatCore + ToPrimitive,
fn from_scaled_float<T>(value: T) -> ConversionResult<V>where
T: FloatCore + ToPrimitive,
Convert a float in the range -1.0 .. +1.0 to a sample value. Read more