#[repr(C)]pub struct CalcResolveContext {
pub items: CalcAstItemVec,
pub em_size: f32,
pub rem_size: f32,
}Expand description
Font-size context captured at style-translation time and stored alongside the calc AST.
Taffy’s resolve_calc_value callback only receives (*const (), f32) — no node id.
We therefore bundle the per-node font sizes into the heap-pinned data that the opaque
pointer references, so the evaluator can resolve em / rem correctly.
Fields§
§items: CalcAstItemVecThe calc AST items (flat stack-machine representation).
em_size: f32Element’s computed font-size in px — used for em resolution.
rem_size: f32Root element’s computed font-size in px — used for rem resolution.
Trait Implementations§
Source§impl Clone for CalcResolveContext
impl Clone for CalcResolveContext
Source§fn clone(&self) -> CalcResolveContext
fn clone(&self) -> CalcResolveContext
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for CalcResolveContext
impl RefUnwindSafe for CalcResolveContext
impl Send for CalcResolveContext
impl Sync for CalcResolveContext
impl Unpin for CalcResolveContext
impl UnsafeUnpin for CalcResolveContext
impl UnwindSafe for CalcResolveContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more