pub struct Min(/* private fields */);Expand description
A lower clamp on one axis: a number of logical px, or the node’s own
fit size on that axis (minWidth: "fit", Min::FIT). FIT is what
lets a Grow child keep a content floor — CSS’s flex: 1 0 auto: the
tabs of an i3-style bar split the bar evenly while they fit and sit at
their label’s width, scrolling, once they do not. Layout resolves it
to a number in the fit pass of its axis (layout::fit_widths /
fit_heights), so every later clamp reads one; until then it clamps
like no floor at all.
Undeclared is Min::AUTO, which clamps as 0 everywhere but one
place: a child giving in an overflowing row that holds a share of the
room, where it is CSS’s min-width: auto — the child’s min-content,
the widest thing in it that cannot wrap (backlog RG92). A declared 0
(minWidth: 0, Min::px(0.0)) is no floor there either, as CSS’s
min-width: 0 is how a flex item is let go below its content.
One f32, with FIT as a negative — the form KuiSpec.min_w takes
too (KUI_MIN_FIT) — rather than an enum with a tag: LayoutSpec is
copied per node per frame, and a tagged pair for two axes is eight
bytes on every node for a floor almost none declares (C15). A negative
floor never meant anything, so the slot was free.
Implementations§
Source§impl Min
impl Min
Sourcepub const AUTO: Min
pub const AUTO: Min
No floor declared: the node’s min-content where a share of the room
gives in CSS’s way (backlog RG92) and down a column of fit
children (F114); 0 across a run of fit children alone, across a
column, where a fit node is held to the column’s box (F116), and
for a node that scrolls or clips.
Negative zero, so it is 0 to every clamp and to ==, and told
apart from a declared 0 by its sign alone (Min::is_auto).
Sourcepub fn px(v: f32) -> Min
pub fn px(v: f32) -> Min
A floor of v logical px; a negative (or NaN) is a floor of 0,
declared — no automatic one either.
Trait Implementations§
impl Copy for Min
impl StructuralPartialEq for Min
Auto Trait Implementations§
impl Freeze for Min
impl RefUnwindSafe for Min
impl Send for Min
impl Sync for Min
impl Unpin for Min
impl UnsafeUnpin for Min
impl UnwindSafe for Min
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.