pub trait RangeConstruction {
type Identity: Copy + Eq;
// Required methods
fn identity(&self) -> Self::Identity;
fn has_canonical_function(&self) -> bool;
fn input_bound(
&self,
value: &Value,
control: &ProductionControl<'_>,
) -> Result<Produced<Value>>;
fn compare_bounds(
&self,
left: &Value,
right: &Value,
control: &ProductionControl<'_>,
) -> Result<Ordering>;
// Provided method
fn canonicalize(
&self,
_range: &CanonicalRange<Self::Identity>,
_control: &ProductionControl<'_>,
) -> Result<Option<Produced<CanonicalRange<Self::Identity>>>> { ... }
}Expand description
Operations selected by the range definition, independently of its endpoint layout. Invocation state and effects belong to the caller; observation never uses this interface.
Required Associated Types§
Required Methods§
fn identity(&self) -> Self::Identity
Sourcefn has_canonical_function(&self) -> bool
fn has_canonical_function(&self) -> bool
Whether the definition selected a canonical function. Adjacency may invoke it on the gap between disjoint bounds.
Sourcefn input_bound(
&self,
value: &Value,
control: &ProductionControl<'_>,
) -> Result<Produced<Value>>
fn input_bound( &self, value: &Value, control: &ProductionControl<'_>, ) -> Result<Produced<Value>>
Decode one present endpoint, including its selected input and domain checks.
fn compare_bounds( &self, left: &Value, right: &Value, control: &ProductionControl<'_>, ) -> Result<Ordering>
Provided Methods§
Sourcefn canonicalize(
&self,
_range: &CanonicalRange<Self::Identity>,
_control: &ProductionControl<'_>,
) -> Result<Option<Produced<CanonicalRange<Self::Identity>>>>
fn canonicalize( &self, _range: &CanonicalRange<Self::Identity>, _control: &ProductionControl<'_>, ) -> Result<Option<Produced<CanonicalRange<Self::Identity>>>>
Invoke the optional canonical function for a nonempty range. None retains the borrowed input unchanged; a replacement must own all its allocations under control. Returning SQL NULL is an invocation error, not None. The input’s owner remains live throughout the call and cannot escape with an empty replacement lease.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".