pub struct TextResourceBudget {
pub line_layout_cache_max_entries: usize,
pub line_layout_cache_low_watermark: usize,
pub raster_bounds_cache_max_entries: Option<usize>,
}Expand description
Text system resource budget.
Fields§
§line_layout_cache_max_entries: usizeMaximum number of entries in the global line-layout cache.
When the cache reaches this limit, older entries are evicted down to the low watermark. Default: 10 000.
Each entry occupies approximately 1.2 KB on average (varies with text length and font complexity).
line_layout_cache_low_watermark: usizeTarget number of entries to retain after eviction.
When the cache exceeds line_layout_cache_max_entries, it evicts the
oldest entries until only low_watermark remain. A larger gap between
max and low watermark reduces eviction frequency but allows more peak
memory usage. Default: 5 000.
raster_bounds_cache_max_entries: Option<usize>Maximum number of entries in the glyph raster-bounds cache.
This cache maps RenderGlyphParams → Bounds<DevicePixels>. Each entry
is small (~120 bytes), but without a limit the cache can grow unbounded
when many distinct font/size/glyph combinations are used. When the
limit is reached the entire cache is cleared (a simple generational
strategy, since re-computing raster bounds is inexpensive compared to
full text shaping).
Default: None (legacy behavior). Preset profiles may set a finite
limit.
Trait Implementations§
Source§impl Clone for TextResourceBudget
impl Clone for TextResourceBudget
Source§fn clone(&self) -> TextResourceBudget
fn clone(&self) -> TextResourceBudget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TextResourceBudget
impl RefUnwindSafe for TextResourceBudget
impl Send for TextResourceBudget
impl Sync for TextResourceBudget
impl Unpin for TextResourceBudget
impl UnsafeUnpin for TextResourceBudget
impl UnwindSafe for TextResourceBudget
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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