pub enum ScreenOrientation {
Portrait,
Landscape,
PortraitUpsideDown,
LandscapeLeft,
LandscapeRight,
}Expand description
Normalized device or window screen orientation across mobile, tablet, desktop, and web.
Variants§
Portrait
Standard upright portrait orientation (height >= width).
Landscape
Standard horizontal landscape orientation (width > height).
PortraitUpsideDown
Upside-down portrait orientation.
LandscapeLeft
Landscape orientation rotated counter-clockwise.
LandscapeRight
Landscape orientation rotated clockwise.
Implementations§
Source§impl ScreenOrientation
Orientation classification helpers for ScreenOrientation.
impl ScreenOrientation
Orientation classification helpers for ScreenOrientation.
Sourcepub fn from_size(width: f32, height: f32) -> ScreenOrientation
pub fn from_size(width: f32, height: f32) -> ScreenOrientation
Sourcepub fn is_landscape(&self) -> bool
pub fn is_landscape(&self) -> bool
Sourcepub fn is_portrait(&self) -> bool
pub fn is_portrait(&self) -> bool
Trait Implementations§
Source§impl Clone for ScreenOrientation
impl Clone for ScreenOrientation
Source§fn clone(&self) -> ScreenOrientation
fn clone(&self) -> ScreenOrientation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ScreenOrientation
Source§impl Debug for ScreenOrientation
impl Debug for ScreenOrientation
Source§impl Default for ScreenOrientation
impl Default for ScreenOrientation
Source§fn default() -> ScreenOrientation
fn default() -> ScreenOrientation
Returns the “default value” for a type. Read more
impl Eq for ScreenOrientation
Source§impl Hash for ScreenOrientation
impl Hash for ScreenOrientation
Source§impl Ord for ScreenOrientation
impl Ord for ScreenOrientation
Source§fn cmp(&self, other: &ScreenOrientation) -> Ordering
fn cmp(&self, other: &ScreenOrientation) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ScreenOrientation
impl PartialEq for ScreenOrientation
Source§impl PartialOrd for ScreenOrientation
impl PartialOrd for ScreenOrientation
impl StructuralPartialEq for ScreenOrientation
Auto Trait Implementations§
impl Forget for ScreenOrientation
impl Freeze for ScreenOrientation
impl Move for ScreenOrientation
impl RefUnwindSafe for ScreenOrientation
impl Send for ScreenOrientation
impl Sync for ScreenOrientation
impl Unpin for ScreenOrientation
impl UnsafeUnpin for ScreenOrientation
impl UnwindSafe for ScreenOrientation
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