pub enum Orientation {
Unknown,
PortraitUp,
PortraitDown,
LandscapeUp,
LandscapeDown,
FaceUp,
FaceDown,
}
Expand description
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§
Source§impl Orientation
impl Orientation
Sourcepub fn is_landscape(self) -> bool
pub fn is_landscape(self) -> bool
Is the device in a landscape orientation?
Sourcepub fn is_portrait(self) -> bool
pub fn is_portrait(self) -> bool
Is the device in a portrait orientation?
Trait Implementations§
Source§impl Clone for Orientation
impl Clone for Orientation
Source§fn clone(&self) -> Orientation
fn clone(&self) -> Orientation
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Orientation
impl Debug for Orientation
Source§impl PartialEq for Orientation
impl PartialEq for Orientation
impl Copy for Orientation
impl Eq for Orientation
impl StructuralPartialEq for Orientation
Auto Trait Implementations§
impl Freeze for Orientation
impl RefUnwindSafe for Orientation
impl Send for Orientation
impl Sync for Orientation
impl Unpin for Orientation
impl UnwindSafe for Orientation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more