[][src]Enum accelerometer::orientation::Orientation

pub enum Orientation {
    Unknown,
    PortraitUp,
    PortraitDown,
    LandscapeUp,
    LandscapeDown,
    FaceUp,
    FaceDown,
}

Device orientation as computed from accelerometer data

Variants

Unknown

Unable to determine the orientation from current data

PortraitUp

Device is in portrait mode in whatever way is considered "up"

PortraitDown

Device is in portrait mode in whatever way is considered "down"

LandscapeUp

Device is in landscape mode in whatever way is considered "up"

LandscapeDown

Device is in landscape mode in whatever way is considered "down"

FaceUp

Device is parallel to the ground, facing up

FaceDown

Device is parallel to the ground, facing down

Implementations

impl Orientation[src]

pub fn is_flat(self) -> bool[src]

Is this orientation considered to be flat?

pub fn is_landscape(self) -> bool[src]

Is the device in a landscape orientation?

pub fn is_portrait(self) -> bool[src]

Is the device in a portrait orientation?

Trait Implementations

impl Clone for Orientation[src]

impl Copy for Orientation[src]

impl Debug for Orientation[src]

impl Eq for Orientation[src]

impl PartialEq<Orientation> for Orientation[src]

impl StructuralEq for Orientation[src]

impl StructuralPartialEq for Orientation[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.