pub struct PrecomputedScattering {
pub pedal_hash: u32,
pub sample_rate: f64,
pub stages: Vec<PrecomputedStage>,
pub interp_tables: Vec<PrecomputedInterpTable>,
}Expand description
A complete precomputed scattering package for one .pedal file.
Fields§
§pedal_hash: u32FNV-1a hash of the .pedal source text used to produce this file.
Checked at load time to detect stale .pksc files.
sample_rate: f64Sample rate this package was compiled for (Hz).
stages: Vec<PrecomputedStage>One entry per compiled stage in topological processing order.
interp_tables: Vec<PrecomputedInterpTable>Pot interpolation tables (one per stage that has a single pot).
Implementations§
Source§impl PrecomputedScattering
impl PrecomputedScattering
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>, PrecomputeError>
pub fn to_bytes(&self) -> Result<Vec<u8>, PrecomputeError>
Serialize to the .pksc binary format.
§Errors
Returns an error if the internal Vec write fails (practically
infallible, but propagated for API consistency).
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, PrecomputeError>
pub fn from_bytes(data: &[u8]) -> Result<Self, PrecomputeError>
Deserialize from the .pksc binary format.
Returns PrecomputeError::BadMagic if the magic bytes are wrong,
PrecomputeError::BadVersion if the version is unsupported, or an
I/O error if the data is truncated.
Trait Implementations§
Source§impl Clone for PrecomputedScattering
impl Clone for PrecomputedScattering
Source§fn clone(&self) -> PrecomputedScattering
fn clone(&self) -> PrecomputedScattering
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 PrecomputedScattering
impl RefUnwindSafe for PrecomputedScattering
impl Send for PrecomputedScattering
impl Sync for PrecomputedScattering
impl Unpin for PrecomputedScattering
impl UnsafeUnpin for PrecomputedScattering
impl UnwindSafe for PrecomputedScattering
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