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

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> { ... } }

Vectors with numeric components

Associated Types

type Axes: ArrayLength<Self::Component>

Number of axes

type Component: Component

Type representing measured acceleration for a particular axis

Loading content...

Associated Constants

const MIN: Self::Component

Smallest value representable by a vector component

const MAX: Self::Component

Largest value representable by a vector component

Loading content...

Required methods

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

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>

Get the component value for a particular index

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

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

Loading content...

Provided methods

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

Instantiate a vector from a slice of components.

Panics if the slice is not the right size.

Important traits for Iter<'a, V>
fn iter(&self) -> Iter<Self>

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 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 I8x2[src]

type Component = i8

type Axes = U2

impl Vector for I8x3[src]

type Component = i8

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

impl Vector for U8x2[src]

type Component = u8

type Axes = U2

impl Vector for U8x3[src]

type Component = u8

type Axes = U3

Loading content...