pub struct SampleSize { /* private fields */ }
Expand description
The size of a single sample as a total number of bits, and the number of “valid” bits.
The number of valid bits is always less than or equal to the total.
Implementations§
Source§impl SampleSize
impl SampleSize
Sourcepub const fn from_full_bits(total_bits: NonZeroU32) -> Self
pub const fn from_full_bits(total_bits: NonZeroU32) -> Self
Returns a SampleSize where all given bits are valid.
Sourcepub const fn from_partial_bits(
valid_bits: NonZeroU32,
total_bits: NonZeroU32,
) -> Option<Self>
pub const fn from_partial_bits( valid_bits: NonZeroU32, total_bits: NonZeroU32, ) -> Option<Self>
Returns a SampleSize where some bits are valid, if the number of valid bits is less than or equal to the total bits.
pub const fn total_bits(&self) -> NonZeroU32
pub const fn total_bytes(&self) -> NonZeroU32
pub const fn valid_bits(&self) -> NonZeroU32
Trait Implementations§
Source§impl Clone for SampleSize
impl Clone for SampleSize
Source§fn clone(&self) -> SampleSize
fn clone(&self) -> SampleSize
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SampleSize
impl Debug for SampleSize
Source§impl Display for SampleSize
impl Display for SampleSize
Source§impl FromStr for SampleSize
impl FromStr for SampleSize
Source§impl PartialEq for SampleSize
impl PartialEq for SampleSize
impl Copy for SampleSize
impl Eq for SampleSize
impl StructuralPartialEq for SampleSize
Auto Trait Implementations§
impl Freeze for SampleSize
impl RefUnwindSafe for SampleSize
impl Send for SampleSize
impl Sync for SampleSize
impl Unpin for SampleSize
impl UnwindSafe for SampleSize
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)