Skip to main content

ContributionTarget

Trait ContributionTarget 

Source
pub trait ContributionTarget {
    type Contribution: Contribution;
    type Runtime;
    type Error;

    const ID: ContributionTargetId;

    // Required method
    fn build(
        &self,
        contributions: &[(ModuleId, Self::Contribution)],
    ) -> Result<Self::Runtime, Self::Error>;
}
Expand description

A domain-owned compiler from declarations to a runtime representation.

The target owns validation, conflict rules, ordering, and its empty-input behavior. Core does not prescribe any of those semantics.

Required Associated Constants§

Source

const ID: ContributionTargetId

Stable semantic identity; not a display label.

Required Associated Types§

Source

type Contribution: Contribution

The declaration type accepted by this target.

Source

type Runtime

The representation retained for runtime execution.

Source

type Error

A structured, target-specific assembly error.

Required Methods§

Source

fn build( &self, contributions: &[(ModuleId, Self::Contribution)], ) -> Result<Self::Runtime, Self::Error>

Validates, orders, and compiles declarations into the runtime form.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§