Skip to main content

IntoRhs

Trait IntoRhs 

Source
pub trait IntoRhs<'a> {
    // Required method
    fn fold_rhs(self, lhs: Expr<'a>) -> (Expr<'a>, f64);

    // Provided method
    fn const_bound(&self) -> Option<f64> { ... }
}
Expand description

What can appear on the right-hand side of a constraint. Numeric scalars stay as the canonical rhs. Expressions get subtracted into the LHS.

Required Methods§

Source

fn fold_rhs(self, lhs: Expr<'a>) -> (Expr<'a>, f64)

Provided Methods§

Source

fn const_bound(&self) -> Option<f64>

The numeric value when this RHS is a pure constant bound (a literal), else None. Used by the range-constraint registration to decide whether lo <= e <= hi collapses to one interval row: expression/param bounds return None so they stay two general constraints (keeping the symbolic bound re-bindable). Defaults to None.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'a> IntoRhs<'a> for f64

Source§

fn fold_rhs(self, lhs: Expr<'a>) -> (Expr<'a>, f64)

Source§

fn const_bound(&self) -> Option<f64>

Source§

impl<'a> IntoRhs<'a> for i32

Source§

fn fold_rhs(self, lhs: Expr<'a>) -> (Expr<'a>, f64)

Source§

fn const_bound(&self) -> Option<f64>

Implementors§

Source§

impl<'a> IntoRhs<'a> for Expr<'a>