Struct discrete::Pair

source ·
pub struct Pair<T = Data>(/* private fields */);
Expand description

Dimension is natural number, position is (min, max).

Trait Implementations§

source§

impl<T> Construct for Pair<T>

source§

fn new() -> Self

Constructs a new Self.
source§

impl Space<BigUint> for Pair<Data>

§

type Dim = BigUint

The dimension type of the space.
§

type Pos = (BigUint, BigUint)

The position type of the space.
source§

fn count(&self, dim: &BigUint) -> BigUint

Counts the size of space given the dimensions.
source§

fn zero(&self, _dim: &BigUint) -> (BigUint, BigUint)

Creates a default element.
source§

fn to_index(&self, _dim: &Self::Dim, (min, max): &Self::Pos) -> BigUint

Converts position to index.
source§

fn to_pos(&self, _dim: &BigUint, index: BigUint, pos: &mut (BigUint, BigUint))

Converts index to position.
source§

impl<N, T> Space<N> for Pair<Of<T>>
where T: Space<N>, Pair<Data>: Space<N, Dim = N, Pos = (N, N)>,

§

type Dim = <T as Space<N>>::Dim

The dimension type of the space.
§

type Pos = (<T as Space<N>>::Pos, <T as Space<N>>::Pos)

The position type of the space.
source§

fn count(&self, dim: &Self::Dim) -> N

Counts the size of space given the dimensions.
source§

fn zero(&self, dim: &Self::Dim) -> Self::Pos

Creates a default element.
source§

fn to_index(&self, dim: &Self::Dim, (min, max): &Self::Pos) -> N

Converts position to index.
source§

fn to_pos(&self, dim: &Self::Dim, index: N, (min, max): &mut Self::Pos)

Converts index to position.
source§

impl Space<usize> for Pair<Data>

§

type Dim = usize

The dimension type of the space.
§

type Pos = (usize, usize)

The position type of the space.
source§

fn count(&self, dim: &usize) -> usize

Counts the size of space given the dimensions.
source§

fn zero(&self, _dim: &usize) -> (usize, usize)

Creates a default element.
source§

fn to_index(&self, _dim: &usize, (min, max): &(usize, usize)) -> usize

Converts position to index.
source§

fn to_pos(&self, _dim: &usize, index: usize, pos: &mut (usize, usize))

Converts index to position.

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Pair<T>
where T: RefUnwindSafe,

§

impl<T> Send for Pair<T>
where T: Send,

§

impl<T> Sync for Pair<T>
where T: Sync,

§

impl<T> Unpin for Pair<T>
where T: Unpin,

§

impl<T> UnwindSafe for Pair<T>
where T: UnwindSafe,

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<D, T> Count<D, BigUint> for T
where T: Space<BigUint, Dim = D>,

source§

fn count(&self, dim: &D) -> BigUint

Counts the size of space given the dimensions.
source§

impl<D, T> Count<D, usize> for T
where T: Space<usize, Dim = D>,

source§

fn count(&self, dim: &D) -> usize

Counts the size of space given the dimensions.
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<D, P, T> ToIndex<D, P, BigUint> for T
where T: Space<BigUint, Dim = D, Pos = P>,

source§

fn to_index(&self, dim: &D, pos: &P) -> BigUint

Converts position to index.
source§

impl<D, P, T> ToIndex<D, P, usize> for T
where T: Space<usize, Dim = D, Pos = P>,

source§

fn to_index(&self, dim: &D, pos: &P) -> usize

Converts position to index.
source§

impl<D, P, T> ToPos<D, P, BigUint> for T
where T: Space<BigUint, Dim = D, Pos = P>,

source§

fn to_pos(&self, dim: &D, ind: BigUint, pos: &mut P)

Converts index to position.
source§

impl<D, P, T> ToPos<D, P, usize> for T
where T: Space<usize, Dim = D, Pos = P>,

source§

fn to_pos(&self, dim: &D, ind: usize, pos: &mut P)

Converts index to position.
source§

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

§

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>,

§

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.
source§

impl<D, P, T> Zero<D, P, BigUint> for T
where T: Space<BigUint, Dim = D, Pos = P>,

source§

fn zero(&self, dim: &D) -> P

Creates a default element.
source§

impl<D, P, T> Zero<D, P, usize> for T
where T: Space<usize, Dim = D, Pos = P>,

source§

fn zero(&self, dim: &D) -> P

Creates a default element.