View

Trait View 

Source
pub trait View: ViewRaw {
    // Required methods
    fn try_set_min(self, min: i32, ctx: &mut Context<'_>) -> Option<i32>;
    fn try_set_max(self, max: i32, ctx: &mut Context<'_>) -> Option<i32>;

    // Provided methods
    fn get_underlying_var(self) -> Option<VarId> { ... }
    fn min(self, ctx: &Context<'_>) -> i32 { ... }
    fn max(self, ctx: &Context<'_>) -> i32 { ... }
}
Expand description

Apply simple domain transformations on the fly to make propagators more generic.

Required Methods§

Source

fn try_set_min(self, min: i32, ctx: &mut Context<'_>) -> Option<i32>

Try to set the provided value as domain minimum, failing the search space on infeasibility.

The None case signals failure, otherwise the new minimum is returned.

Source

fn try_set_max(self, max: i32, ctx: &mut Context<'_>) -> Option<i32>

Try to the set provided value as domain maximum, failing the search space on infeasibility.

The None case signals failure, otherwise the new maximum is returned.

Provided Methods§

Source

fn get_underlying_var(self) -> Option<VarId>

Get the handle of the variable this view depends on.

Source

fn min(self, ctx: &Context<'_>) -> i32

Access domain minimum.

Source

fn max(self, ctx: &Context<'_>) -> i32

Access domain maximum.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl View for i32

Source§

fn try_set_min(self, min: i32, _ctx: &mut Context<'_>) -> Option<i32>

Source§

fn try_set_max(self, max: i32, _ctx: &mut Context<'_>) -> Option<i32>

Implementors§

Source§

impl View for VarId

Source§

impl View for VarIdBinary

Source§

impl<V: View> View for Times<V>

Source§

impl<V: View> View for Opposite<V>

Source§

impl<V: View> View for Plus<V>

Source§

impl<V: View> View for TimesPos<V>