pub struct SizingContext {
pub viewport: Viewport,
pub container_size: Size<Option<f32>>,
pub font_size: f32,
pub root_font_size: Option<f32>,
pub line_height: f32,
pub root_line_height: Option<f32>,
pub calc_arena: Rc<CalcArena>,
}Expand description
The sizing context used for length value resolving.
Fields§
§viewport: ViewportThe viewport for the image renderer.
container_size: Size<Option<f32>>The nearest query container size (content box) in device pixels.
font_size: f32The font size in pixels.
root_font_size: Option<f32>Computed font-size of the root element in device pixels. None before
the root has been resolved; readers should fall back to viewport.font_size.
https://www.w3.org/TR/css-values-4/#rem
line_height: f32Pixel basis for the lh unit.
root_line_height: Option<f32>Pixel basis for the rlh unit; None before root is resolved.
calc_arena: Rc<CalcArena>The calc arena shared by the current layout tree.
Implementations§
Source§impl SizingContext
impl SizingContext
pub fn root_line_height_basis(&self) -> f32
pub fn query_container_width(&self) -> f32
pub fn query_container_height(&self) -> f32
Trait Implementations§
Source§impl Clone for SizingContext
impl Clone for SizingContext
Source§fn clone(&self) -> SizingContext
fn clone(&self) -> SizingContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SizingContext
impl !Send for SizingContext
impl !Sync for SizingContext
impl !UnwindSafe for SizingContext
impl Freeze for SizingContext
impl Unpin for SizingContext
impl UnsafeUnpin for SizingContext
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