pub enum SizeClass {
Compact,
Medium,
Expanded,
}Expand description
A display-width band.
Thresholds (logical px): Compact < 600, Medium 600–840, Expanded ≥ 840.
Variants§
Compact
Phone / narrow window (< 600).
Medium
Portrait tablet / medium window (600–840).
Expanded
Desktop / wide window (≥ 840).
Implementations§
Source§impl SizeClass
impl SizeClass
Sourcepub fn from_width(width: f32) -> SizeClass
pub fn from_width(width: f32) -> SizeClass
The class matching a width (logical px).
Sourcepub fn from_height(height: f32) -> SizeClass
pub fn from_height(height: f32) -> SizeClass
The class matching a height (logical px), using the same thresholds.
Useful on the vertical axis: a short window (< 600) is Compact in height,
which is a cue to hide labels, shrink margins, and so on.
Trait Implementations§
impl Copy for SizeClass
impl Eq for SizeClass
Source§impl Ord for SizeClass
impl Ord for SizeClass
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 PartialOrd for SizeClass
impl PartialOrd for SizeClass
impl StructuralPartialEq for SizeClass
Auto Trait Implementations§
impl Freeze for SizeClass
impl RefUnwindSafe for SizeClass
impl Send for SizeClass
impl Sync for SizeClass
impl Unpin for SizeClass
impl UnsafeUnpin for SizeClass
impl UnwindSafe for SizeClass
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