Trait micromath::vector::Vector[][src]

pub trait Vector: Copy + Debug + Default + Index<usize> + PartialEq + Sized + Send + Sync {
    type Axes: ArrayLength<Self::Component>;
    type Component: Component;

    const MIN: Self::Component;
    const MAX: Self::Component;

    fn from_iter<I>(iter: I) -> Self
    where
        I: IntoIterator<Item = Self::Component>
;
fn get(self, index: usize) -> Option<Self::Component>;
fn to_array(self) -> GenericArray<Self::Component, Self::Axes>; fn from_slice(slice: &[Self::Component]) -> Self { ... }
fn iter(&self) -> Iter<'_, Self>

Notable traits for Iter<'a, V>

impl<'a, V> Iterator for Iter<'a, V> where
    V: Vector
type Item = V::Component;
{ ... } }
This is supported on crate feature vector only.

Vectors with numeric components

Associated Types

type Axes: ArrayLength<Self::Component>[src]

Number of axes

type Component: Component[src]

Type representing measured acceleration for a particular axis

Loading content...

Associated Constants

const MIN: Self::Component[src]

Smallest value representable by a vector component

const MAX: Self::Component[src]

Largest value representable by a vector component

Loading content...

Required methods

fn from_iter<I>(iter: I) -> Self where
    I: IntoIterator<Item = Self::Component>, 
[src]

Instantiate a Vector from an iterator over Self::Component values.

Panics of the iterator is not the correct length.

fn get(self, index: usize) -> Option<Self::Component>[src]

Get the component value for a particular index

fn to_array(self) -> GenericArray<Self::Component, Self::Axes>[src]

Obtain an array of the acceleration components for each of the axes

Loading content...

Provided methods

fn from_slice(slice: &[Self::Component]) -> Self[src]

Instantiate a vector from a slice of components.

Panics if the slice is not the right size.

fn iter(&self) -> Iter<'_, Self>

Notable traits for Iter<'a, V>

impl<'a, V> Iterator for Iter<'a, V> where
    V: Vector
type Item = V::Component;
[src]

Iterate over the components of a vector

Loading content...

Implementors

impl Vector for F32x2[src]

type Component = f32

type Axes = U2

impl Vector for F32x3[src]

type Component = f32

type Axes = U3

impl Vector for I8x2[src]

type Component = i8

type Axes = U2

impl Vector for I8x3[src]

type Component = i8

type Axes = U3

impl Vector for I16x2[src]

type Component = i16

type Axes = U2

impl Vector for I16x3[src]

type Component = i16

type Axes = U3

impl Vector for I32x2[src]

type Component = i32

type Axes = U2

impl Vector for I32x3[src]

type Component = i32

type Axes = U3

impl Vector for U8x2[src]

type Component = u8

type Axes = U2

impl Vector for U8x3[src]

type Component = u8

type Axes = U3

impl Vector for U16x2[src]

type Component = u16

type Axes = U2

impl Vector for U16x3[src]

type Component = u16

type Axes = U3

impl Vector for U32x2[src]

type Component = u32

type Axes = U2

impl Vector for U32x3[src]

type Component = u32

type Axes = U3

Loading content...