pub enum WidthClass {
Compact,
Medium,
Expanded,
Large,
ExtraLarge,
}Expand description
How wide a window is, in coarse buckets (docs/size-classes.md).
The breakpoints are Android’s window size classes, in density-independent points, and they are
used verbatim on every backend rather than per-platform. One table means one answer: a 700pt
window is WidthClass::Medium on a Mac, in a browser, and on a tablet, so an app that lays
out from the class gets the same layout at the same size everywhere. Apple publishes only two
buckets (compact/regular); those map onto this table rather than replacing it, with
WidthClass::Compact the compact one and everything above it regular.
Variants§
Compact
< 600dp: a phone in portrait. One pane at a time.
Medium
600–839dp: a tablet in portrait, a narrow desktop window.
Expanded
840–1199dp: a tablet in landscape, a typical desktop window.
Large
1200–1599dp: a large desktop window.
ExtraLarge
≥ 1600dp: a maximized window on a big display.
Trait Implementations§
Source§impl Clone for WidthClass
impl Clone for WidthClass
Source§fn clone(&self) -> WidthClass
fn clone(&self) -> WidthClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WidthClass
Source§impl Debug for WidthClass
impl Debug for WidthClass
Source§impl Default for WidthClass
impl Default for WidthClass
Source§fn default() -> WidthClass
fn default() -> WidthClass
impl Eq for WidthClass
Source§impl Ord for WidthClass
impl Ord for WidthClass
Source§fn cmp(&self, other: &WidthClass) -> Ordering
fn cmp(&self, other: &WidthClass) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for WidthClass
impl PartialEq for WidthClass
Source§impl PartialOrd for WidthClass
impl PartialOrd for WidthClass
impl StructuralPartialEq for WidthClass
Auto Trait Implementations§
impl Freeze for WidthClass
impl RefUnwindSafe for WidthClass
impl Send for WidthClass
impl Sync for WidthClass
impl Unpin for WidthClass
impl UnsafeUnpin for WidthClass
impl UnwindSafe for WidthClass
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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