pub struct PartialClock { /* private fields */ }Expand description
Tracks wall-clock spacing between partial attempts.
Implementations§
Source§impl PartialClock
impl PartialClock
pub fn new(policy: PartialWindowPolicy) -> Self
pub fn policy(&self) -> &PartialWindowPolicy
Sourcepub fn interval_elapsed(&self) -> bool
pub fn interval_elapsed(&self) -> bool
True if enough time has elapsed since the last partial (or never ran).
Sourcepub fn ready(&self, samples: &[f32]) -> bool
pub fn ready(&self, samples: &[f32]) -> bool
Ready for another partial given full buffer samples. Energy is evaluated on the same rolling window that would be decoded.
Sourcepub fn take_partial_slice<'a>(
&mut self,
samples: &'a [f32],
) -> Option<&'a [f32]>
pub fn take_partial_slice<'a>( &mut self, samples: &'a [f32], ) -> Option<&'a [f32]>
Slice + mark if ready; returns None if not ready.
Trait Implementations§
Source§impl Clone for PartialClock
impl Clone for PartialClock
Source§fn clone(&self) -> PartialClock
fn clone(&self) -> PartialClock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PartialClock
impl RefUnwindSafe for PartialClock
impl Send for PartialClock
impl Sync for PartialClock
impl Unpin for PartialClock
impl UnsafeUnpin for PartialClock
impl UnwindSafe for PartialClock
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more