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 (Min::FIT, minWidth: "fit" in the
bindings). FIT is what lets a Grow child keep a content floor, like
CSS’s flex: 1 0 auto: tabs split a 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, 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. A
declared 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.
Stored as one f32 with FIT and a calc as negatives (the form the
C struct’s min_w takes too), because LayoutSpec is copied per node
per frame.
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 and down a column of fit children; 0 across a
run of fit children alone, across a column, where a fit node is
held to the column’s box, 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.