IntDom

Enum IntDom 

Source
pub enum IntDom<N> {
    BTree(BTreeDom<N>),
    Minimal(MinimalDom<N>),
    Range(RangeDom<N>),
}
Expand description

An enum representing all the builtin integer domains.

Variants§

§

BTree(BTreeDom<N>)

§

Minimal(MinimalDom<N>)

§

Range(RangeDom<N>)

Implementations§

Source§

impl<N: Int> IntDom<N>

Source

pub fn btree_from_bounds(min: N, max: N) -> Self

Source

pub fn range_from_bounds(min: N, max: N) -> Self

Trait Implementations§

Source§

impl<N: Clone> Clone for IntDom<N>

Source§

fn clone(&self) -> IntDom<N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N: Int> IntDomain for IntDom<N>

Source§

type Value = N

The type of integer the domain holds.
Source§

fn from_bounds(min: N, max: N) -> Self

Creates a new domain equivalent to the inclusive range min..=max. Read more
Source§

fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = N> + 'a>

Returns an iterator over all the values in the domain. Read more
Source§

fn remove(&mut self, value: N)

Applies the decision x != value. Read more
Source§

fn empty() -> Self

Creates an empty domain. Read more
Source§

fn assigned(value: N) -> Self

Creates a domain assigned to the given value. Read more
Source§

fn size(&self) -> usize

Returns the number of values in the domain. Read more
Source§

fn is_empty(&self) -> bool

Checks if the domain is empty. Read more
Source§

fn is_assigned(&self) -> bool

Checks if the domain is assigned. Read more
Source§

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

Checks if the domain contains a given value. Read more
Source§

fn value(&self) -> Option<N>

Returns the value of the domain if the domain is assigned, or None otherwise. Read more
Source§

fn min(&self) -> Option<N>

Returns the minimum value in the domain, or None if the domain is empty. Read more
Source§

fn max(&self) -> Option<N>

Returns the maximum value in the domain, or None if the domain is empty. Read more
Source§

fn assign(&mut self, value: N)

Assigns the domain to a given value. Read more
Source§

fn adjust_min(&mut self, new_min: N)

Sets the new minimum value for the domain. Read more
Source§

fn adjust_max(&mut self, new_max: N)

Sets the new maximum value for the domain. Read more

Auto Trait Implementations§

§

impl<N> Freeze for IntDom<N>
where N: Freeze,

§

impl<N> RefUnwindSafe for IntDom<N>
where N: RefUnwindSafe,

§

impl<N> Send for IntDom<N>
where N: Send,

§

impl<N> Sync for IntDom<N>
where N: Sync,

§

impl<N> Unpin for IntDom<N>
where N: Unpin,

§

impl<N> UnwindSafe for IntDom<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.