Skip to main content

LeafMeasureContext

Struct LeafMeasureContext 

Source
pub struct LeafMeasureContext<'a> {
    pub store: &'a NodeStore,
    pub node: NodeId,
    pub known_dimensions: Size<Option<f32>>,
    pub available_space: Size<AvailableSpace>,
    pub text_measurer: &'a dyn TextMeasurer,
    pub resolved_text: &'a ResolvedTextStyle,
    pub aspect_ratio: Option<f32>,
}
Expand description

Compact, zero-allocation context passed to LeafMeasureHook::measure during Taffy leaf measurement.

Fields§

§store: &'a NodeStore

Live NodeStore for reading the leaf’s own word tables and strings.

§node: NodeId

The leaf node being measured.

§known_dimensions: Size<Option<f32>>

Definite border-box dimensions already known by Taffy (if any).

§available_space: Size<AvailableSpace>

Available space from the parent container on each axis.

§text_measurer: &'a dyn TextMeasurer

Active text measurer installed on the layout engine (for TextInput, Gauge, etc.).

§resolved_text: &'a ResolvedTextStyle

Inherited resolved typography for Self::node.

§aspect_ratio: Option<f32>

Resolved explicit CSS aspect-ratio (width / height, finite and > 0.0), if authored.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for LeafMeasureContext<'a>

§

impl<'a> !UnwindSafe for LeafMeasureContext<'a>

§

impl<'a> Forget for LeafMeasureContext<'a>

§

impl<'a> Freeze for LeafMeasureContext<'a>

§

impl<'a> Move for LeafMeasureContext<'a>

§

impl<'a> Send for LeafMeasureContext<'a>

§

impl<'a> Sync for LeafMeasureContext<'a>
where RawVecInner: Sync, Arc<OwnedTableDesc>: Sync, OnceLock<TypeId>: Sync, RawTable<((u64, u64), ResourceId)>: Sync,

§

impl<'a> Unpin for LeafMeasureContext<'a>

§

impl<'a> UnsafeUnpin for LeafMeasureContext<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.