Skip to main content

QuirkRegistry

Trait QuirkRegistry 

Source
pub trait QuirkRegistry {
    type Quirk: Serialize + DeserializeOwned + Clone;

    // Required method
    fn registry() -> Vec<(&'static str, Vec<Self::Quirk>)>;

    // Provided methods
    fn for_package(name: &str) -> Vec<Self::Quirk> { ... }
    fn registered_names() -> Vec<&'static str> { ... }
}
Expand description

The typed shape of an adapter’s quirk registry. The registry is the canonical knowledge of “which upstream packages need which build-time workarounds.” Each adapter ships its own typed quirk enum + a const REGISTRY table.

Implementations should be implementable from a TOML side-table (declarative) or a Rust constructor function — both are valid. The QuirkRegistry derive macro auto-implements from TOML.

Required Associated Types§

Source

type Quirk: Serialize + DeserializeOwned + Clone

The ecosystem’s typed quirk variant set.

Required Methods§

Source

fn registry() -> Vec<(&'static str, Vec<Self::Quirk>)>

Full registry — every (package_name, quirks) pair the adapter knows about. Sorted by package name for stable diffs.

Provided Methods§

Source

fn for_package(name: &str) -> Vec<Self::Quirk>

Lookup quirks for a single package by name. Returns empty Vec when no quirks registered (never None).

Source

fn registered_names() -> Vec<&'static str>

Every package name with at least one registered quirk. Used by invariants to detect drift between the registry and the spec’s emission.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§