Skip to main content

SemanticLinearizeRule

Trait SemanticLinearizeRule 

Source
pub trait SemanticLinearizeRule:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn family_id(&self) -> &'static str;
    fn linearize(
        &self,
        request: SemanticLinearizeRequest<'_>,
        builder: &mut SemanticProgramBuilder,
    ) -> Result<SemanticLinearizeResult, SemanticAdError>;
}
Expand description

Definitional JVP rule for one extension family.

Required Methods§

Source

fn family_id(&self) -> &'static str

Return the versioned extension family handled by this rule.

Source

fn linearize( &self, request: SemanticLinearizeRequest<'_>, builder: &mut SemanticProgramBuilder, ) -> Result<SemanticLinearizeResult, SemanticAdError>

Emit ordered tangent outputs and residuals into builder.

§Errors

Returns SemanticAdError::Unsupported when the payload is outside the rule’s supported domain, or SemanticAdError::Build when emitted semantic operations fail validation.

Implementors§