Direction

Struct Direction 

Source
pub struct Direction<const D: usize> { /* private fields */ }
Expand description

Represent a cardinal direction

Implementations§

Source§

impl<const D: usize> Direction<D>

Source

pub const fn new(index_dir: usize, is_positive: bool) -> Option<Self>

New direction from a direction as an idex and wether it is in the positive direction.

Source

pub fn positives_vec() -> Vec<Self>

List of all positives directions. This is very slow use Self::positive_directions instead.

Source

pub fn directions_vec() -> Vec<Self>

List all directions. This is very slow use DirectionList::directions instead.

Source

pub const fn directions_array<const IS_POSITIVE: bool>() -> [Self; D]

Get all direction with the sign IS_POSITIVE.

Source

pub const fn negative_directions() -> [Self; D]

Get all negative direction

Source

pub const fn positive_directions() -> [Self; D]

Get all positive direction

Source

pub const fn is_positive(&self) -> bool

Get if the position is positive.

Source

pub const fn is_negative(&self) -> bool

Get if the position is Negative. see Direction::is_positive

Source

pub const fn to_positive(self) -> Self

Return the positive direction associated, for example -x gives +x and +x gives +x.

§Example
assert_eq!(
    Direction::<4>::new(1, false).unwrap().to_positive(),
    Direction::<4>::new(1, true).unwrap()
);
assert_eq!(
    Direction::<4>::new(1, true).unwrap().to_positive(),
    Direction::<4>::new(1, true).unwrap()
);
Source

pub const fn index(&self) -> usize

Get a index associated to the direction.

§Example
assert_eq!(Direction::<4>::new(1, false).unwrap().index(), 1);
Source

pub fn to_vector(self, a: f64) -> SVector<Real, D>

Convert the direction into a vector of norm a;

Source

pub const fn dim() -> usize

Returns the dimension

Source

pub fn to_unit_vector(self) -> SVector<Real, D>

Convert the direction into a vector of norm 1;

Source

pub fn from_vector(v: &SVector<Real, D>) -> Self

Find the direction the vector point the most. For a zero vector return DirectionEnum::XPos.

§Example
assert_eq!(
    Direction::from_vector(&nalgebra::Vector4::new(1_f64, 0_f64, 0_f64, 0_f64)),
    Direction::<4>::new(0, true).ok_or(ImplementationError::OptionWithUnexpectedNone)?
);
assert_eq!(
    Direction::from_vector(&nalgebra::Vector4::new(0_f64, -1_f64, 0_f64, 0_f64)),
    Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?
);
assert_eq!(
    Direction::from_vector(&nalgebra::Vector4::new(0.5_f64, 1_f64, 0_f64, 2_f64)),
    Direction::<4>::new(3, true).ok_or(ImplementationError::OptionWithUnexpectedNone)?
);

Trait Implementations§

Source§

impl<const D: usize> Clone for Direction<D>

Source§

fn clone(&self) -> Direction<D>

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<const D: usize> Debug for Direction<D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, const D: usize> Deserialize<'de> for Direction<D>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl DirectionList for Direction<1usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<10usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<100usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<101usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<102usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<103usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<104usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<105usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<106usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<107usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<108usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<109usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<11usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<110usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<111usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<112usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<113usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<114usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<115usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<116usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<117usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<118usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<119usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<12usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<120usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<121usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<122usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<123usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<124usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<125usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<126usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<127usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<13usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<14usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<15usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<16usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<17usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<18usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<19usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<2usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<20usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<21usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<22usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<23usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<24usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<25usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<26usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<27usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<28usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<29usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<3usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<30usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<31usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<32usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<33usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<34usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<35usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<36usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<37usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<38usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<39usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<4usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<40usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<41usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<42usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<43usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<44usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<45usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<46usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<47usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<48usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<49usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<5usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<50usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<51usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<52usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<53usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<54usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<55usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<56usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<57usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<58usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<59usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<6usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<60usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<61usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<62usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<63usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<64usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<65usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<66usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<67usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<68usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<69usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<7usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<70usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<71usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<72usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<73usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<74usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<75usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<76usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<77usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<78usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<79usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<8usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<80usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<81usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<82usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<83usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<84usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<85usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<86usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<87usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<88usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<89usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<9usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<90usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<91usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<92usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<93usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<94usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<95usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<96usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<97usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<98usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl DirectionList for Direction<99usize>

Source§

fn directions() -> &'static [Self]

List all directions.
Source§

fn positive_directions() -> &'static [Self]

List all positive directions.
Source§

impl<const D: usize> Display for Direction<D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Direction<1>> for Direction<10usize>

Source§

fn from(from: &Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<1>> for Direction<2usize>

Source§

fn from(from: &Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<1>> for Direction<3usize>

Source§

fn from(from: &Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<1>> for Direction<4usize>

Source§

fn from(from: &Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<1>> for Direction<5usize>

Source§

fn from(from: &Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<1>> for Direction<6usize>

Source§

fn from(from: &Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<1>> for Direction<7usize>

Source§

fn from(from: &Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<1>> for Direction<8usize>

Source§

fn from(from: &Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<1>> for Direction<9usize>

Source§

fn from(from: &Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<2>> for Direction<10usize>

Source§

fn from(from: &Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<2>> for Direction<3usize>

Source§

fn from(from: &Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<2>> for Direction<4usize>

Source§

fn from(from: &Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<2>> for Direction<5usize>

Source§

fn from(from: &Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<2>> for Direction<6usize>

Source§

fn from(from: &Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<2>> for Direction<7usize>

Source§

fn from(from: &Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<2>> for Direction<8usize>

Source§

fn from(from: &Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<2>> for Direction<9usize>

Source§

fn from(from: &Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<3>> for Direction<10usize>

Source§

fn from(from: &Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<3>> for Direction<4usize>

Source§

fn from(from: &Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<3>> for Direction<5usize>

Source§

fn from(from: &Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<3>> for Direction<6usize>

Source§

fn from(from: &Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<3>> for Direction<7usize>

Source§

fn from(from: &Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<3>> for Direction<8usize>

Source§

fn from(from: &Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<3>> for Direction<9usize>

Source§

fn from(from: &Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<4>> for Direction<10usize>

Source§

fn from(from: &Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<4>> for Direction<5usize>

Source§

fn from(from: &Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<4>> for Direction<6usize>

Source§

fn from(from: &Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<4>> for Direction<7usize>

Source§

fn from(from: &Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<4>> for Direction<8usize>

Source§

fn from(from: &Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<4>> for Direction<9usize>

Source§

fn from(from: &Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<5>> for Direction<10usize>

Source§

fn from(from: &Direction<5usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<5>> for Direction<6usize>

Source§

fn from(from: &Direction<5usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<5>> for Direction<7usize>

Source§

fn from(from: &Direction<5usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<5>> for Direction<8usize>

Source§

fn from(from: &Direction<5usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<5>> for Direction<9usize>

Source§

fn from(from: &Direction<5usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<6>> for Direction<10usize>

Source§

fn from(from: &Direction<6usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<6>> for Direction<7usize>

Source§

fn from(from: &Direction<6usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<6>> for Direction<8usize>

Source§

fn from(from: &Direction<6usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<6>> for Direction<9usize>

Source§

fn from(from: &Direction<6usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<7>> for Direction<10usize>

Source§

fn from(from: &Direction<7usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<7>> for Direction<8usize>

Source§

fn from(from: &Direction<7usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<7>> for Direction<9usize>

Source§

fn from(from: &Direction<7usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<8>> for Direction<10usize>

Source§

fn from(from: &Direction<8usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<8>> for Direction<9usize>

Source§

fn from(from: &Direction<8usize>) -> Self

Converts to this type from the input type.
Source§

impl From<&Direction<9>> for Direction<10usize>

Source§

fn from(from: &Direction<9usize>) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize> From<&Direction<D>> for SVector<Real, D>

Source§

fn from(d: &Direction<D>) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize> From<&Direction<D>> for usize

Source§

fn from(d: &Direction<D>) -> Self

Converts to this type from the input type.
Source§

impl From<&DirectionEnum> for Direction<4>

Source§

fn from(d: &DirectionEnum) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize> From<&Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>> for Direction<D>

Source§

fn from(v: &SVector<Real, D>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<1>> for Direction<10usize>

Source§

fn from(from: Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<1>> for Direction<2usize>

Source§

fn from(from: Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<1>> for Direction<3usize>

Source§

fn from(from: Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<1>> for Direction<4usize>

Source§

fn from(from: Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<1>> for Direction<5usize>

Source§

fn from(from: Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<1>> for Direction<6usize>

Source§

fn from(from: Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<1>> for Direction<7usize>

Source§

fn from(from: Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<1>> for Direction<8usize>

Source§

fn from(from: Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<1>> for Direction<9usize>

Source§

fn from(from: Direction<1usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<2>> for Direction<10usize>

Source§

fn from(from: Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<2>> for Direction<3usize>

Source§

fn from(from: Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<2>> for Direction<4usize>

Source§

fn from(from: Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<2>> for Direction<5usize>

Source§

fn from(from: Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<2>> for Direction<6usize>

Source§

fn from(from: Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<2>> for Direction<7usize>

Source§

fn from(from: Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<2>> for Direction<8usize>

Source§

fn from(from: Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<2>> for Direction<9usize>

Source§

fn from(from: Direction<2usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<3>> for Direction<10usize>

Source§

fn from(from: Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<3>> for Direction<4usize>

Source§

fn from(from: Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<3>> for Direction<5usize>

Source§

fn from(from: Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<3>> for Direction<6usize>

Source§

fn from(from: Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<3>> for Direction<7usize>

Source§

fn from(from: Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<3>> for Direction<8usize>

Source§

fn from(from: Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<3>> for Direction<9usize>

Source§

fn from(from: Direction<3usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<4>> for Direction<10usize>

Source§

fn from(from: Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<4>> for Direction<5usize>

Source§

fn from(from: Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<4>> for Direction<6usize>

Source§

fn from(from: Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<4>> for Direction<7usize>

Source§

fn from(from: Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<4>> for Direction<8usize>

Source§

fn from(from: Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<4>> for Direction<9usize>

Source§

fn from(from: Direction<4usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<5>> for Direction<10usize>

Source§

fn from(from: Direction<5usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<5>> for Direction<6usize>

Source§

fn from(from: Direction<5usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<5>> for Direction<7usize>

Source§

fn from(from: Direction<5usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<5>> for Direction<8usize>

Source§

fn from(from: Direction<5usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<5>> for Direction<9usize>

Source§

fn from(from: Direction<5usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<6>> for Direction<10usize>

Source§

fn from(from: Direction<6usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<6>> for Direction<7usize>

Source§

fn from(from: Direction<6usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<6>> for Direction<8usize>

Source§

fn from(from: Direction<6usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<6>> for Direction<9usize>

Source§

fn from(from: Direction<6usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<7>> for Direction<10usize>

Source§

fn from(from: Direction<7usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<7>> for Direction<8usize>

Source§

fn from(from: Direction<7usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<7>> for Direction<9usize>

Source§

fn from(from: Direction<7usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<8>> for Direction<10usize>

Source§

fn from(from: Direction<8usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<8>> for Direction<9usize>

Source§

fn from(from: Direction<8usize>) -> Self

Converts to this type from the input type.
Source§

impl From<Direction<9>> for Direction<10usize>

Source§

fn from(from: Direction<9usize>) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize> From<Direction<D>> for SVector<Real, D>

Source§

fn from(d: Direction<D>) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize> From<Direction<D>> for usize

Source§

fn from(d: Direction<D>) -> Self

Converts to this type from the input type.
Source§

impl From<DirectionEnum> for Direction<4>

Source§

fn from(d: DirectionEnum) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize> From<Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>> for Direction<D>

Source§

fn from(v: SVector<Real, D>) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize> Hash for Direction<D>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const D: usize> LatticeElementToIndex<D> for Direction<D>

Source§

fn to_index(&self, _: &LatticeCyclic<D>) -> usize

equivalent to Direction::to_index()

Source§

impl<const D: usize> Neg for &Direction<D>

Source§

type Output = Direction<D>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<const D: usize> Neg for Direction<D>

Source§

type Output = Direction<D>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<const D: usize> PartialEq for Direction<D>

Source§

fn eq(&self, other: &Direction<D>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const D: usize> PartialOrd for Direction<D>

Partial ordering is set as follows: two directions can be compared if they have the same index or the same direction sign. In the first case a positive direction is greater than a negative direction In the latter case the ordering is done on the index.

§Example

use std::cmp::Ordering;

let dir_1 =
    Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
let dir_2 =
    Direction::<4>::new(1, true).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
assert!(dir_1 < dir_2);
assert_eq!(dir_1.partial_cmp(&dir_2), Some(Ordering::Less));
//--------
let dir_3 =
    Direction::<4>::new(3, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
let dir_4 =
    Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
assert!(dir_3 > dir_4);
assert_eq!(dir_3.partial_cmp(&dir_4), Some(Ordering::Greater));
//--------
let dir_5 =
    Direction::<4>::new(3, true).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
let dir_6 =
    Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
assert_eq!(dir_5.partial_cmp(&dir_6), None);
//--------
let dir_5 =
    Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
let dir_6 =
    Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
assert_eq!(dir_5.partial_cmp(&dir_6), Some(Ordering::Equal));
Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const D: usize> Serialize for Direction<D>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<&Direction<10>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<10>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<10>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<10>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<10>> for Direction<5usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<10>> for Direction<6usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<10>> for Direction<7usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<10>> for Direction<8usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<10>> for Direction<9usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<2>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<2usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<3>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<3usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<3>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<3usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<4>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<4usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<4>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<4usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<4>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<4usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<5>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<5usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<5>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<5usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<5>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<5usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<5>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<5usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<6>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<6usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<6>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<6usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<6>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<6usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<6>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<6usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<6>> for Direction<5usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<6usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<7>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<7>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<7>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<7>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<7>> for Direction<5usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<7>> for Direction<6usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<8>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<8>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<8>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<8>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<8>> for Direction<5usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<8>> for Direction<6usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<8>> for Direction<7usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<9>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<9>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<9>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<9>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<9>> for Direction<5usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<9>> for Direction<6usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<9>> for Direction<7usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Direction<9>> for Direction<8usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: &Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<10>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<10>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<10>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<10>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<10>> for Direction<5usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<10>> for Direction<6usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<10>> for Direction<7usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<10>> for Direction<8usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<10>> for Direction<9usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<10usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<2>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<2usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<3>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<3usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<3>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<3usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<4>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<4usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<4>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<4usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<4>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<4usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<5>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<5usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<5>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<5usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<5>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<5usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<5>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<5usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<6>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<6usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<6>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<6usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<6>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<6usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<6>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<6usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<6>> for Direction<5usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<6usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<7>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<7>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<7>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<7>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<7>> for Direction<5usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<7>> for Direction<6usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<7usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<8>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<8>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<8>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<8>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<8>> for Direction<5usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<8>> for Direction<6usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<8>> for Direction<7usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<8usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<9>> for Direction<1usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<9>> for Direction<2usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<9>> for Direction<3usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<9>> for Direction<4usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<9>> for Direction<5usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<9>> for Direction<6usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<9>> for Direction<7usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Direction<9>> for Direction<8usize>

Source§

type Error = DirectionConversionError

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

fn try_from(from: Direction<9usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const D: usize> Copy for Direction<D>

Source§

impl<const D: usize> Eq for Direction<D>

Source§

impl<const D: usize> StructuralPartialEq for Direction<D>

Auto Trait Implementations§

§

impl<const D: usize> Freeze for Direction<D>

§

impl<const D: usize> RefUnwindSafe for Direction<D>

§

impl<const D: usize> Send for Direction<D>

§

impl<const D: usize> Sync for Direction<D>

§

impl<const D: usize> Unpin for Direction<D>

§

impl<const D: usize> UnwindSafe for Direction<D>

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ClosedNeg for T
where T: Neg<Output = T>,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,