pub enum Length {
Px(f32),
Percent(f32),
Vw(f32),
Vh(f32),
Auto,
Add(Box<Length>, Box<Length>),
Sub(Box<Length>, Box<Length>),
Mul(Box<Length>, f32),
Div(Box<Length>, f32),
Min(Box<Length>, Box<Length>),
Max(Box<Length>, Box<Length>),
Clamp {
min: Box<Length>,
val: Box<Length>,
max: Box<Length>,
},
}Variants§
Px(f32)
Percent(f32)
Vw(f32)
Vh(f32)
Auto
Add(Box<Length>, Box<Length>)
Sub(Box<Length>, Box<Length>)
Mul(Box<Length>, f32)
Div(Box<Length>, f32)
Min(Box<Length>, Box<Length>)
Max(Box<Length>, Box<Length>)
Clamp
Implementations§
Source§impl Length
impl Length
Sourcepub fn resolve_with(
&self,
containing_block: Option<f32>,
viewport_width: f32,
viewport_height: f32,
) -> Option<f32>
pub fn resolve_with( &self, containing_block: Option<f32>, viewport_width: f32, viewport_height: f32, ) -> Option<f32>
Resolves a length value to pixels.
If the containing block is auto, percentages are treated as auto for layout purposes.
This version uses a single viewport value (for backward compatibility with axis-based layout).
Trait Implementations§
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 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