pub struct ScratchPerformance { /* private fields */ }Expand description
Canonical allocation-free scratch helper for physical player consumers.
Implementations§
Source§impl ScratchPerformance
impl ScratchPerformance
pub fn new(preset: ScratchPreset) -> Self
pub const fn catalog() -> &'static [ScratchPresetDescriptor; 8]
pub fn preset(&self) -> ScratchPreset
pub fn set_preset(&mut self, preset: ScratchPreset)
pub fn clicks(&self) -> u8
pub fn set_clicks(&mut self, clicks: u8)
pub fn audible_gain(&self) -> f64
pub fn gate(&self) -> &ScratchGate
Sourcepub fn output(&self) -> ScratchPerformanceOutput
pub fn output(&self) -> ScratchPerformanceOutput
Reports the current output state without advancing the helper.
Sourcepub fn process_frame(
&mut self,
input: ScratchPerformanceInput,
) -> Result<ScratchPerformanceOutput, ScratchPerformanceError>
pub fn process_frame( &mut self, input: ScratchPerformanceInput, ) -> Result<ScratchPerformanceOutput, ScratchPerformanceError>
Processes one frame after the physical mechanics step for that frame.
pub fn snapshot(&self) -> ScratchPerformanceSnapshot
Sourcepub fn restore(
&mut self,
snapshot: &ScratchPerformanceSnapshot,
) -> Result<(), ScratchPerformanceError>
pub fn restore( &mut self, snapshot: &ScratchPerformanceSnapshot, ) -> Result<(), ScratchPerformanceError>
Restores only after the complete snapshot passes validation.
Trait Implementations§
Source§impl Clone for ScratchPerformance
impl Clone for ScratchPerformance
Source§fn clone(&self) -> ScratchPerformance
fn clone(&self) -> ScratchPerformance
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 moreimpl Copy for ScratchPerformance
Source§impl Debug for ScratchPerformance
impl Debug for ScratchPerformance
Source§impl Default for ScratchPerformance
impl Default for ScratchPerformance
Source§impl PartialEq for ScratchPerformance
impl PartialEq for ScratchPerformance
impl StructuralPartialEq for ScratchPerformance
Auto Trait Implementations§
impl Freeze for ScratchPerformance
impl RefUnwindSafe for ScratchPerformance
impl Send for ScratchPerformance
impl Sync for ScratchPerformance
impl Unpin for ScratchPerformance
impl UnsafeUnpin for ScratchPerformance
impl UnwindSafe for ScratchPerformance
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