pub struct MeasureMemo {
pub intrinsics: HashMap<u32, Intrinsics>,
/* private fields */
}Expand description
The Rust-side memo taffy’s measure closure answers from. Keyed by layout
node index; content_version bumps clear a leaf’s entries.
Fields§
§intrinsics: HashMap<u32, Intrinsics>Implementations§
Source§impl MeasureMemo
impl MeasureMemo
pub fn width_key(width: f32) -> i64
pub fn clear(&mut self)
pub fn forget(&mut self, index: u32)
pub fn height_at(&self, index: u32, width: f32) -> Option<f32>
Sourcepub fn insert_height(&mut self, index: u32, width_key: i64, height: f32)
pub fn insert_height(&mut self, index: u32, width_key: i64, height: f32)
Remember the height at a width key (Self::width_key).
Sourcepub fn heights_of(&self, index: u32) -> &[(i64, f32)]
pub fn heights_of(&self, index: u32) -> &[(i64, f32)]
Every (width key, height) remembered for a leaf.
Source§impl MeasureMemo
impl MeasureMemo
Sourcepub fn answer(&self, req: &MeasureRequest) -> (Size<f32>, bool, Option<f32>)
pub fn answer(&self, req: &MeasureRequest) -> (Size<f32>, bool, Option<f32>)
Answer from the memo. The second value says whether the HEIGHT was a
guess (the max-content height at a narrower width), i.e. a second
phase must ask the host for it; the third is the leaf’s first
baseline (Intrinsics::baseline).
Trait Implementations§
Source§impl Clone for MeasureMemo
impl Clone for MeasureMemo
Source§impl Debug for MeasureMemo
impl Debug for MeasureMemo
Auto Trait Implementations§
impl Freeze for MeasureMemo
impl RefUnwindSafe for MeasureMemo
impl Send for MeasureMemo
impl Sync for MeasureMemo
impl Unpin for MeasureMemo
impl UnsafeUnpin for MeasureMemo
impl UnwindSafe for MeasureMemo
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