Enum WidthClass Copy item path Source 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.
< 600dp: a phone in portrait. One pane at a time.
600–839dp: a tablet in portrait, a narrow desktop window.
840–1199dp: a tablet in landscape, a typical desktop window.
1200–1599dp: a large desktop window.
≥ 1600dp: a maximized window on a big display.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Returns the “default value” for a type.
Read more Compares and returns the maximum of two values.
Read more Compares and returns the minimum of two values.
Read more Restrict a value to a certain interval.
Read more 🔬 This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range.
Read more This method returns an ordering between
self and
other values if one exists.
Read more Tests less than (for
self and
other) and is used by the
< operator.
Read more Tests less than or equal to (for
self and
other) and is used by the
<= operator.
Read more Tests greater than (for
self and
other) and is used by the
>
operator.
Read more Tests greater than or equal to (for
self and
other) and is used by
the
>= operator.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.