pub struct RenderCache {
pub stats: CacheStats,
/* private fields */
}Expand description
Render cache for expensive operations
Fields§
§stats: CacheStatsCache statistics
Implementations§
Source§impl RenderCache
impl RenderCache
Sourcepub fn with_limits(max_shaped: usize, max_drawing: usize) -> Self
pub fn with_limits(max_shaped: usize, max_drawing: usize) -> Self
Create with custom limits
Sourcepub fn get_shaped_text(&mut self, key: &TextCacheKey) -> Option<Arc<ShapedText>>
pub fn get_shaped_text(&mut self, key: &TextCacheKey) -> Option<Arc<ShapedText>>
Get shaped text from cache
Sourcepub fn store_shaped_text(
&mut self,
key: TextCacheKey,
shaped: ShapedText,
) -> Arc<ShapedText>
pub fn store_shaped_text( &mut self, key: TextCacheKey, shaped: ShapedText, ) -> Arc<ShapedText>
Store shaped text in cache
Sourcepub fn get_drawing_path(
&mut self,
key: &DrawingCacheKey,
) -> Option<Option<Path>>
pub fn get_drawing_path( &mut self, key: &DrawingCacheKey, ) -> Option<Option<Path>>
Get drawing path from cache
Sourcepub fn store_drawing_path(&mut self, key: DrawingCacheKey, path: Option<Path>)
pub fn store_drawing_path(&mut self, key: DrawingCacheKey, path: Option<Path>)
Store drawing path in cache
Sourcepub fn stats(&self) -> &CacheStats
pub fn stats(&self) -> &CacheStats
Get cache statistics
Sourcepub fn print_stats(&self)
pub fn print_stats(&self)
Print cache statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RenderCache
impl RefUnwindSafe for RenderCache
impl Send for RenderCache
impl Sync for RenderCache
impl Unpin for RenderCache
impl UnsafeUnpin for RenderCache
impl UnwindSafe for RenderCache
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
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().