pub enum ScreenOrientationLock {
Any,
Natural,
Landscape,
Portrait,
PortraitPrimary,
PortraitSecondary,
LandscapePrimary,
LandscapeSecondary,
}Expand description
Represents the possible screen orientation lock modes. Passed to UseScreenOrientationReturn::lock_orientation.
Variants§
Any
Any of PortraitPrimary, PortraitSecondary, LandscapePrimary or LandscapeSecondary.
Natural
The natural orientation of the screen from the underlying operating system: either PortraitPrimary or LandscapePrimary.
Landscape
An orientation where screen width is greater than the screen height.
Depending on the platform convention, this may be LandscapePrimary, LandscapeSecondary, or both.
Portrait
An orientation where screen height is greater than the screen width.
Depending on the platform convention, this may be PortraitPrimary, PortraitSecondary, or both.
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 ScreenOrientationLock
impl Clone for ScreenOrientationLock
Source§fn clone(&self) -> ScreenOrientationLock
fn clone(&self) -> ScreenOrientationLock
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScreenOrientationLock
impl Debug for ScreenOrientationLock
Source§impl Hash for ScreenOrientationLock
impl Hash for ScreenOrientationLock
Source§impl PartialEq for ScreenOrientationLock
impl PartialEq for ScreenOrientationLock
impl Copy for ScreenOrientationLock
impl Eq for ScreenOrientationLock
impl StructuralPartialEq for ScreenOrientationLock
Auto Trait Implementations§
impl Freeze for ScreenOrientationLock
impl RefUnwindSafe for ScreenOrientationLock
impl Send for ScreenOrientationLock
impl Sync for ScreenOrientationLock
impl Unpin for ScreenOrientationLock
impl UnwindSafe for ScreenOrientationLock
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