pub enum Length {
Px(f64),
Percent(f64),
}Expand description
Length carries f64 payloads so it intentionally only implements
PartialEq — f64 is not Eq. By extension, Value::LengthSet
and any container of Value cannot be Eq either. Adapters that
want hashable/Eq-equivalent comparison should compare a derived
representation (e.g. rendered floem Style).
Variants§
Px(f64)
CSS pixels. Unitless values in the source are parsed as Px too — floem doesn’t distinguish, and the layout engine treats both the same.
em / rem are deferred to a later phase; document the gap here
so it is easy to find.
Percent(f64)
<n>% of the parent’s relevant dimension.
Implementations§
Trait Implementations§
impl Copy for Length
impl StructuralPartialEq for Length
Auto Trait Implementations§
impl Freeze for Length
impl RefUnwindSafe for Length
impl Send for Length
impl Sync for Length
impl Unpin for Length
impl UnsafeUnpin for Length
impl UnwindSafe for Length
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
Mutably borrows from an owned value. Read more