Skip to main content

Width

Enum Width 

Source
#[non_exhaustive]
pub enum Width { Content, Fixed, Fill, }
Expand description

How much room a placement asks for.

A column says it, and so does a Field. An intent, so the actual floor stays with makeover-geometry. goingson’s task table spells these as minmax(200px, 1fr), 140px and content-sized; only the first three words of that survive deferral. #[non_exhaustive], for the reason Fill and FieldKind are: a renderer matches on this and a vocabulary that grows must not break every renderer when it does.

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.
§

Content

Takes what it needs and no more.

§

Fixed

A fixed share, the same at every width.

§

Fill

Absorbs whatever is left over.

Several fills divide what is left equally. Stated because it would otherwise be undefined and each renderer would invent something, and stated this way because equal division is the only sharing rule that answers to “Any width, one answer” without a tiebreak: allocating in declaration order makes the result depend on the order the description was written in, which is a fact about the source file and not about the screen. It documents what both renderers already do — CSS grid gives 1fr 1fr, ratatui gives each a Constraint::Fill(1) — rather than changing anything.

So a row of fills is a legal thing to describe, and there is no rule against it. Measured 2026-08-16, every table in the tree uses exactly one, which is the discipline this would otherwise have had to forbid.

Trait Implementations§

Source§

impl Clone for Width

Source§

fn clone(&self) -> Width

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 Width

Source§

impl Debug for Width

Source§

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

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

impl Eq for Width

Source§

impl Hash for Width

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 Width

Source§

fn eq(&self, other: &Width) -> 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 Width

Auto Trait Implementations§

§

impl Freeze for Width

§

impl RefUnwindSafe for Width

§

impl Send for Width

§

impl Sync for Width

§

impl Unpin for Width

§

impl UnsafeUnpin for Width

§

impl UnwindSafe for Width

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.