[][src]Struct accelerometer::vector::U8x2

pub struct U8x2 {
    pub x: u8,
    pub y: u8,
}

2-dimensional XY vector of u8 values

Fields

x: u8

X component

y: u8

Y component

Methods

impl U8x2[src]

pub fn new(x: u8, y: u8) -> Self[src]

Instantiate from X and Y components

Trait Implementations

impl Vector for U8x2[src]

type Component = u8

Type representing measured acceleration for a particular axis

type Axes = U2

Number of axes

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

Instantiate a vector from a slice of components. Read more

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

Iterate over the components of a vector

fn distance(self, other: Self) -> f32[src]

Compute the distance between two vectors

fn magnitude(self) -> f32[src]

Compute the magnitude of a vector

impl Copy for U8x2[src]

impl Debug for U8x2[src]

impl PartialEq<U8x2> for U8x2[src]

impl From<(u8, u8)> for U8x2[src]

impl From<U8x2> for F32x2[src]

impl MulAssign<f32> for U8x2[src]

impl MulAssign<u8> for U8x2[src]

impl Index<usize> for U8x2[src]

type Output = u8

The returned type after indexing.

impl Clone for U8x2[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for U8x2[src]

Auto Trait Implementations

impl Send for U8x2

impl Sync for U8x2

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self