Skip to main content

ParamRegistry

Trait ParamRegistry 

Source
pub trait ParamRegistry:
    Debug
    + Send
    + Sync {
    // Required methods
    fn synth(&self) -> Synth;
    fn entries(&self) -> &[ParamSpec];
    fn get(&self, key: &str) -> Option<&ParamSpec>;
    fn calibration(&self) -> &CalibrationSet;

    // Provided methods
    fn iter(&self) -> Iter<'_, ParamSpec> ⓘ { ... }
    fn close_names(&self, wrong: &str, limit: usize) -> Vec<&str> { ... }
}
Expand description

The parameter registry of one synth.

Required Methods§

Source

fn synth(&self) -> Synth

The synth the registry describes.

Source

fn entries(&self) -> &[ParamSpec]

Every entry, sorted by key.

Source

fn get(&self, key: &str) -> Option<&ParamSpec>

The entry of a key.

Source

fn calibration(&self) -> &CalibrationSet

The calibration tables loaded into the registry.

Provided Methods§

Source

fn iter(&self) -> Iter<'_, ParamSpec> ⓘ

Every entry, sorted by key.

Source

fn close_names(&self, wrong: &str, limit: usize) -> Vec<&str>

Up to limit keys close to a wrong key, nearest first.

A key qualifies when its edit distance is at most max(2, len / 3) of the wrong key, or it contains the wrong text. Ties sort by key. A wrong key longer than 64 characters has none: no key is that long, and the distance would cost its length times every key.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§