pub enum Orientation {
Portrait,
Landscape,
}Expand description
Display orientation, derived from the width-to-height ratio.
A second axis of responsiveness, independent of the size class: the same width can be portrait (phone held upright) or landscape (phone on its side), which sometimes calls for a different layout.
Variants§
Implementations§
Source§impl Orientation
impl Orientation
Sourcepub fn from_size(width: f32, height: f32) -> Orientation
pub fn from_size(width: f32, height: f32) -> Orientation
The orientation of a window of the given dimensions (logical px).
Sourcepub fn is_portrait(self) -> bool
pub fn is_portrait(self) -> bool
true when portrait (taller than wide).
Sourcepub fn is_landscape(self) -> bool
pub fn is_landscape(self) -> bool
true when landscape (wider than tall).
Trait Implementations§
Source§impl Clone for Orientation
impl Clone for Orientation
Source§fn clone(&self) -> Orientation
fn clone(&self) -> Orientation
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 Orientation
Source§impl Debug for Orientation
impl Debug for Orientation
impl Eq for Orientation
Source§impl PartialEq for Orientation
impl PartialEq 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 UnsafeUnpin 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