Skip to main content

DomainView

Trait DomainView 

Source
pub trait DomainView {
    type Value: Copy + Eq + Ord + Debug;

    // Required methods
    fn is_empty(&self) -> bool;
    fn is_fixed(&self) -> bool;
    fn size(&self) -> usize;
    fn min(&self) -> Option<Self::Value>;
    fn max(&self) -> Option<Self::Value>;
    fn contains(&self, value: Self::Value) -> bool;
}
Expand description

Read-only interface for inspecting a variable domain.

Required Associated Types§

Source

type Value: Copy + Eq + Ord + Debug

Value type stored in the domain.

Required Methods§

Source

fn is_empty(&self) -> bool

Returns true when the domain contains no values.

Source

fn is_fixed(&self) -> bool

Returns true when the domain contains exactly one value.

Source

fn size(&self) -> usize

Returns the number of values in the domain.

Source

fn min(&self) -> Option<Self::Value>

Returns the smallest value in the domain, if any.

Source

fn max(&self) -> Option<Self::Value>

Returns the largest value in the domain, if any.

Source

fn contains(&self, value: Self::Value) -> bool

Returns true when the domain contains value.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§