pub struct SampleStorage { /* private fields */ }Expand description
A validated sample storage domain.
Significant bits may be narrower than an integer storage word. Packed samples occupy exactly their significant-bit width. Floating-point samples must occupy an entire 16-, 32-, or 64-bit word.
Implementations§
Source§impl SampleStorage
impl SampleStorage
Sourcepub fn new(
class: SampleClass,
significant_bits: u8,
unit: StorageUnit,
) -> StorageResult<Self>
pub fn new( class: SampleClass, significant_bits: u8, unit: StorageUnit, ) -> StorageResult<Self>
Validates a numeric class, significant-bit count, and physical unit.
§Errors
Rejects zero bits, more than 64 packed bits, significant widths larger than a byte or word, one-bit signed samples, and floating-point storage that is packed, byte-sized, padded, or not 16/32/64 bits wide.
Sourcepub const fn class(self) -> SampleClass
pub const fn class(self) -> SampleClass
Returns the sample’s numeric class.
Sourcepub const fn significant_bits(self) -> u8
pub const fn significant_bits(self) -> u8
Returns the number of meaningful bits in the sample.
Sourcepub const fn unit(self) -> StorageUnit
pub const fn unit(self) -> StorageUnit
Returns the physical storage unit.
Sourcepub const fn storage_bits(self) -> u8
pub const fn storage_bits(self) -> u8
Returns the number of bits charged for each stored sample.
Sourcepub const fn byte_order(self) -> Option<ByteOrder>
pub const fn byte_order(self) -> Option<ByteOrder>
Returns the byte order when the unit is a multi-byte word.
Trait Implementations§
Source§impl Clone for SampleStorage
impl Clone for SampleStorage
impl Copy for SampleStorage
Source§impl Debug for SampleStorage
impl Debug for SampleStorage
impl Eq for SampleStorage
Source§impl Hash for SampleStorage
impl Hash for SampleStorage
Source§impl PartialEq for SampleStorage
impl PartialEq for SampleStorage
impl StructuralPartialEq for SampleStorage
Auto Trait Implementations§
impl Freeze for SampleStorage
impl RefUnwindSafe for SampleStorage
impl Send for SampleStorage
impl Sync for SampleStorage
impl Unpin for SampleStorage
impl UnsafeUnpin for SampleStorage
impl UnwindSafe for SampleStorage
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