Skip to main content

Normalize

Trait Normalize 

Source
pub trait Normalize: Copy {
    type Term;

    const INDEX: &'static str;

    // Required method
    fn normalize(
        &self,
        ty: Option<Logical>,
        value: Physical<'_>,
    ) -> Result<Self::Term, NormalizeError>;
}
Expand description

How Terms turns one scalar into a term.

Equality is the normalizer this crate is about. An index of another kind supplies its own, with a term type of its own (an order index seals its term so only a scheme can read it) and the same outcome contract: a scalar whose kind has no term under this index (a null, a boolean) returns NormalizeError::NoDomain, and Terms skips it when it has no logical type; a scalar whose logical type has no term returns the same error and stops the walk; any other error stops the walk too.

A normalizer is copied into every child sink of a walk, so it is Copy: it carries settings, such as the type an index declares, but no state that a walk changes.

Required Associated Constants§

Source

const INDEX: &'static str

The kind of index the terms are for, as a refusal names it: "equality" for Equality, so a scalar it cannot normalize is reported as having no equality term.

Required Associated Types§

Source

type Term

What one scalar becomes.

Required Methods§

Source

fn normalize( &self, ty: Option<Logical>, value: Physical<'_>, ) -> Result<Self::Term, NormalizeError>

The term for one scalar, or why it has none.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Normalize for Equality

Source§

const INDEX: &'static str = "equality"

Source§

type Term = Normalized