pub enum SizeClass {
Compact,
Medium,
Expanded,
}Expand description
Shell available-width band. Aligned to Material breakpoints and computed
from the full client-area width, not the physical screen. Ord follows
the declared order (Compact < Medium < Expanded). Content sees
ContentSizeClass instead.
Variants§
Implementations§
Source§impl SizeClass
impl SizeClass
pub fn from_width(width: f64) -> Self
Sourcepub fn resolve(prev: Option<SizeClass>, width: f64, margin: f64) -> Self
pub fn resolve(prev: Option<SizeClass>, width: f64, margin: f64) -> Self
Resolve with hysteresis: only switch class when width clears the
boundary by margin, otherwise keep prev (prevents edge flicker).
Sourcepub fn to_content(self) -> ContentSizeClass
pub fn to_content(self) -> ContentSizeClass
Author-facing content class: shell medium and expanded collapse to
regular.
Trait Implementations§
impl Copy for SizeClass
Source§impl<'de> Deserialize<'de> for SizeClass
impl<'de> Deserialize<'de> for SizeClass
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SizeClass
Source§impl From<SizeClass> for ContentSizeClass
impl From<SizeClass> for ContentSizeClass
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