Skip to main content

Measure

Enum Measure 

Source
#[non_exhaustive]
pub enum Measure { Wide, Contained, Reading, }
Expand description

How wide the content of a whole screen runs.

0eccff0d, and Share’s sibling one level up: that one says how a screen’s width is divided between regions, this says how much of the window the screen uses in the first place. Both are the description’s, which is what answering the two together settled.

Measured in the MNW server, where 69 of 72 templates carry exactly one of three mutually exclusive classes and the choice is per screen. GoingsOn reaches for max-width 56 times and Balanced Breakfast 12, neither with a token for it, so three apps were solving one thing by hand.

§Named for the measure, not for MNW’s classes

A renderer that is not a browser has to answer this too, and padded-page tells a terminal nothing. The three say how wide the text runs, which is a question every renderer can answer: a webview with a max-width, a terminal with gutters, an immediate-mode frame with its own width.

#[non_exhaustive] for Fill’s reason. The set is closed today because the measurement found three, and a fourth arriving should not be a lockstep release across nine repos.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Wide

The whole width, with gutters. The default, and 53 of the 69.

What a dashboard, a table and a settings screen want: the content is wide because the content is wide, and constraining it would waste the window.

§

Contained

Capped at a comfortable page width, centred. 13 of the 69.

A form, a sign-in, a purchase. Content that does not get better by getting wider, but is not prose either.

§

Reading

Capped at a line length that reads well. 3 of the 69.

Prose. The narrowest of the three, and the one with a reason outside taste: a line of text past roughly 75 characters costs the reader the return sweep.

Implementations§

Source§

impl Measure

Source

pub const fn as_str(self) -> &'static str

A stable name, for a renderer that needs to spell it.

Here rather than in each renderer for Sort::as_str’s reason: three renderers spelling one enum is three chances to spell it differently.

Trait Implementations§

Source§

impl Clone for Measure

Source§

fn clone(&self) -> Measure

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Measure

Source§

impl Debug for Measure

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Measure

Source§

fn default() -> Measure

Returns the “default value” for a type. Read more
Source§

impl Eq for Measure

Source§

impl Hash for Measure

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Measure

Source§

fn eq(&self, other: &Measure) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Measure

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.