Trait Space

Source
pub trait Space {
    type Value: Clone;

    const DIM: usize;

    // Required methods
    fn card(&self) -> Card;
    fn contains(&self, val: &Self::Value) -> bool;
}
Expand description

Trait for defining geometric spaces.

Required Associated Constants§

Source

const DIM: usize

The dimensionality of the space.

Required Associated Types§

Source

type Value: Clone

The data representation of elements of the space.

Required Methods§

Source

fn card(&self) -> Card

Return the number of elements in the set comprising the space.

Source

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

Returns true iff val is contained within the space.

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 Space for Range<usize>

Source§

const DIM: usize = 1usize

Source§

type Value = usize

Source§

fn card(&self) -> Card

Source§

fn contains(&self, val: &usize) -> bool

Source§

impl<'a, D: Space> Space for &'a D

Source§

const DIM: usize = D::DIM

Source§

type Value = <D as Space>::Value

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D1: Space, D2: Space> Space for (D1, D2)

Source§

const DIM: usize = 2usize

Source§

type Value = (<D1 as Space>::Value, <D2 as Space>::Value)

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D1: Space, D2: Space, D3: Space> Space for (D1, D2, D3)

Source§

const DIM: usize = 3usize

Source§

type Value = (<D1 as Space>::Value, <D2 as Space>::Value, <D3 as Space>::Value)

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D1: Space, D2: Space, D3: Space, D4: Space> Space for (D1, D2, D3, D4)

Source§

const DIM: usize = 4usize

Source§

type Value = (<D1 as Space>::Value, <D2 as Space>::Value, <D3 as Space>::Value, <D4 as Space>::Value)

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D1: Space, D2: Space, D3: Space, D4: Space, D5: Space> Space for (D1, D2, D3, D4, D5)

Source§

const DIM: usize = 5usize

Source§

type Value = (<D1 as Space>::Value, <D2 as Space>::Value, <D3 as Space>::Value, <D4 as Space>::Value, <D5 as Space>::Value)

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D1: Space, D2: Space, D3: Space, D4: Space, D5: Space, D6: Space> Space for (D1, D2, D3, D4, D5, D6)

Source§

const DIM: usize = 6usize

Source§

type Value = (<D1 as Space>::Value, <D2 as Space>::Value, <D3 as Space>::Value, <D4 as Space>::Value, <D5 as Space>::Value, <D6 as Space>::Value)

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D1: Space, D2: Space, D3: Space, D4: Space, D5: Space, D6: Space, D7: Space> Space for (D1, D2, D3, D4, D5, D6, D7)

Source§

const DIM: usize = 7usize

Source§

type Value = (<D1 as Space>::Value, <D2 as Space>::Value, <D3 as Space>::Value, <D4 as Space>::Value, <D5 as Space>::Value, <D6 as Space>::Value, <D7 as Space>::Value)

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D1: Space, D2: Space, D3: Space, D4: Space, D5: Space, D6: Space, D7: Space, D8: Space> Space for (D1, D2, D3, D4, D5, D6, D7, D8)

Source§

const DIM: usize = 8usize

Source§

type Value = (<D1 as Space>::Value, <D2 as Space>::Value, <D3 as Space>::Value, <D4 as Space>::Value, <D5 as Space>::Value, <D6 as Space>::Value, <D7 as Space>::Value, <D8 as Space>::Value)

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D1: Space, D2: Space, D3: Space, D4: Space, D5: Space, D6: Space, D7: Space, D8: Space, D9: Space> Space for (D1, D2, D3, D4, D5, D6, D7, D8, D9)

Source§

const DIM: usize = 9usize

Source§

type Value = (<D1 as Space>::Value, <D2 as Space>::Value, <D3 as Space>::Value, <D4 as Space>::Value, <D5 as Space>::Value, <D6 as Space>::Value, <D7 as Space>::Value, <D8 as Space>::Value, <D9 as Space>::Value)

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D1: Space, D2: Space, D3: Space, D4: Space, D5: Space, D6: Space, D7: Space, D8: Space, D9: Space, D10: Space> Space for (D1, D2, D3, D4, D5, D6, D7, D8, D9, D10)

Source§

const DIM: usize = 10usize

Source§

type Value = (<D1 as Space>::Value, <D2 as Space>::Value, <D3 as Space>::Value, <D4 as Space>::Value, <D5 as Space>::Value, <D6 as Space>::Value, <D7 as Space>::Value, <D8 as Space>::Value, <D9 as Space>::Value, <D10 as Space>::Value)

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D1: Space, D2: Space, D3: Space, D4: Space, D5: Space, D6: Space, D7: Space, D8: Space, D9: Space, D10: Space, D11: Space> Space for (D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11)

Source§

const DIM: usize = 11usize

Source§

type Value = (<D1 as Space>::Value, <D2 as Space>::Value, <D3 as Space>::Value, <D4 as Space>::Value, <D5 as Space>::Value, <D6 as Space>::Value, <D7 as Space>::Value, <D8 as Space>::Value, <D9 as Space>::Value, <D10 as Space>::Value, <D11 as Space>::Value)

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D1: Space, D2: Space, D3: Space, D4: Space, D5: Space, D6: Space, D7: Space, D8: Space, D9: Space, D10: Space, D11: Space, D12: Space> Space for (D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12)

Source§

const DIM: usize = 12usize

Source§

type Value = (<D1 as Space>::Value, <D2 as Space>::Value, <D3 as Space>::Value, <D4 as Space>::Value, <D5 as Space>::Value, <D6 as Space>::Value, <D7 as Space>::Value, <D8 as Space>::Value, <D9 as Space>::Value, <D10 as Space>::Value, <D11 as Space>::Value, <D12 as Space>::Value)

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D: Space> Space for Box<D>

Source§

const DIM: usize = D::DIM

Source§

type Value = <D as Space>::Value

Source§

fn card(&self) -> Card

Source§

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

Source§

impl<D: Space, const N: usize> Space for [D; N]

Source§

const DIM: usize = N

Source§

type Value = [<D as Space>::Value; N]

Source§

fn card(&self) -> Card

Source§

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

Implementors§