pub struct ParagraphMetricsCache { /* private fields */ }Expand description
Per-engine paragraph metrics cache.
Metrics are indexed by the same geometry key as layouts. Aggregate metadata is absent until a visible-layout build completes.
§Examples
use ailloli_ui_editor::layout::ParagraphMetricsCache;
let cache = ParagraphMetricsCache::default();
assert!(cache.metadata().is_none());Implementations§
Source§impl ParagraphMetricsCache
Resolves, updates, and invalidates paragraph metrics.
impl ParagraphMetricsCache
Resolves, updates, and invalidates paragraph metrics.
Sourcepub fn metadata(&self) -> Option<&ParagraphMetricsMetadata>
pub fn metadata(&self) -> Option<&ParagraphMetricsMetadata>
Returns aggregate metadata from the last completed layout build.
Returns None before the first build and after Self::clear.
§Examples
use ailloli_ui_editor::layout::ParagraphMetricsCache;
assert!(ParagraphMetricsCache::default().metadata().is_none());Trait Implementations§
Source§impl Clone for ParagraphMetricsCache
impl Clone for ParagraphMetricsCache
Source§fn clone(&self) -> ParagraphMetricsCache
fn clone(&self) -> ParagraphMetricsCache
Returns a copy 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 moreSource§impl Debug for ParagraphMetricsCache
impl Debug for ParagraphMetricsCache
Source§impl Default for ParagraphMetricsCache
impl Default for ParagraphMetricsCache
Source§fn default() -> ParagraphMetricsCache
fn default() -> ParagraphMetricsCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ParagraphMetricsCache
impl RefUnwindSafe for ParagraphMetricsCache
impl Send for ParagraphMetricsCache
impl Sync for ParagraphMetricsCache
impl Unpin for ParagraphMetricsCache
impl UnwindSafe for ParagraphMetricsCache
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