pub struct TextMeasurementCache { /* private fields */ }Expand description
Cache and evaluator for intrinsic text measurements with call counting and constraint caching.
Implementations§
Source§impl TextMeasurementCache
impl TextMeasurementCache
Sourcepub fn call_count(&self) -> usize
pub fn call_count(&self) -> usize
Returns the number of measurement calculations performed.
Sourcepub fn cache_hits(&self) -> usize
pub fn cache_hits(&self) -> usize
Returns the number of cache hits.
Sourcepub fn reset_counts(&mut self)
pub fn reset_counts(&mut self)
Resets call and hit counters.
Sourcepub fn measure_text(
&mut self,
text: &str,
font_size: f32,
line_height: f32,
known_dimensions: Size<Option<f32>>,
available_space: Size<AvailableSpace>,
) -> Size<f32>
pub fn measure_text( &mut self, text: &str, font_size: f32, line_height: f32, known_dimensions: Size<Option<f32>>, available_space: Size<AvailableSpace>, ) -> Size<f32>
Measures text with line wrapping under available space constraints.
- Unconstrained (
MaxContentor width >= natural width): returns natural single-line dimensions. - Constrained (known width or
Definitewidth < natural width): wraps text, expanding height. - Empty text (
""): collapses width to 0.0 while preserving font line height.
Trait Implementations§
Source§impl Clone for TextMeasurementCache
impl Clone for TextMeasurementCache
Source§impl Debug for TextMeasurementCache
impl Debug for TextMeasurementCache
Auto Trait Implementations§
impl Forget for TextMeasurementCache
impl Freeze for TextMeasurementCache
impl Move for TextMeasurementCache
impl RefUnwindSafe for TextMeasurementCache
impl Send for TextMeasurementCache
impl Sync for TextMeasurementCache
impl Unpin for TextMeasurementCache
impl UnsafeUnpin for TextMeasurementCache
impl UnwindSafe for TextMeasurementCache
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