pub enum ScreenOrientation {
PortraitPrimary,
PortraitSecondary,
LandscapePrimary,
LandscapeSecondary,
}Expand description
Represents the possible screen orientations. Returned by UseScreenOrientationReturn::orientation.
Variants§
PortraitPrimary
The “primary” portrait mode.
If the natural orientation is a portrait mode (screen height is greater than width),
this will be the same as the natural orientation, and correspond to an angle of 0 degrees.
If the natural orientation is a landscape mode,
then the user agent can choose either portrait orientation as the PortraitPrimary and PortraitSecondary;
one of those will be assigned the angle of 90 degrees and the other will have an angle of 270 degrees.
PortraitSecondary
The secondary portrait orientation.
If the natural orientation is a portrait mode, this will have an angle of 180 degrees
(in other words, the device is upside down relative to its natural orientation).
If the natural orientation is a landscape mode,
this can be either orientation as selected by the user agent: whichever was not selected for PortraitPrimary.
LandscapePrimary
The “primary” landscape mode.
If the natural orientation is a landscape mode (screen width is greater than height),
this will be the same as the natural orientation, and correspond to an angle of 0 degrees.
If the natural orientation is a portrait mode,
then the user agent can choose either landscape orientation as the landscape-primary
with an angle of either 90 or 270 degrees (LandscapeSecondary will be the other orientation and angle).
LandscapeSecondary
The secondary landscape mode.
If the natural orientation is a landscape mode,
this orientation is upside down relative to the natural orientation, and will have an angle of 180 degrees.
If the natural orientation is a portrait mode, this can be either orientation as selected by the user agent:
whichever was not selected for LandscapePrimary.
Trait Implementations§
Source§impl Clone for ScreenOrientation
impl Clone for ScreenOrientation
Source§fn clone(&self) -> ScreenOrientation
fn clone(&self) -> ScreenOrientation
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScreenOrientation
impl Debug for ScreenOrientation
Source§impl Hash for ScreenOrientation
impl Hash for ScreenOrientation
Source§impl PartialEq for ScreenOrientation
impl PartialEq for ScreenOrientation
impl Copy for ScreenOrientation
impl Eq for ScreenOrientation
impl StructuralPartialEq for ScreenOrientation
Auto Trait Implementations§
impl Freeze for ScreenOrientation
impl RefUnwindSafe for ScreenOrientation
impl Send for ScreenOrientation
impl Sync for ScreenOrientation
impl Unpin for ScreenOrientation
impl UnwindSafe for ScreenOrientation
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more