Trait Scope

Source
pub trait Scope<'a, T: 'a = usize> {
    // Required methods
    fn size(&self) -> usize;
    fn value(&'a self, index: usize) -> T;
    fn len(&self) -> usize;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn iter_values(&'a self) -> ScopeIter<'a, T> 
       where Self: Sized { ... }
}
Expand description

Size and solution domain of a problem

Required Methods§

Source

fn size(&self) -> usize

Return number values needed for a complete solution

Source

fn value(&'a self, index: usize) -> T

Return value from solution domain

§Arguments
  • index: index < than len into domain
Source

fn len(&self) -> usize

Return number of domain values

Provided Methods§

Source

fn is_empty(&self) -> bool

Source

fn iter_values(&'a self) -> ScopeIter<'a, T>
where Self: Sized,

Implementors§

Source§

impl Scope<'_> for BitQueens

Source§

impl Scope<'_> for CountUp

Source§

impl Scope<'_> for NQueens

Source§

impl Scope<'_> for TotalSum