From 9488b1b850152eb564dbfefc898c962bdac73eb4 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 20 Jul 2021 20:21:56 +0200 Subject: Main context struct --- src/cache.rs | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 src/cache.rs (limited to 'src/cache.rs') diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index 2aa276aa..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,30 +0,0 @@ -//! Caching of compilation artifacts. - -use crate::font::FontCache; -use crate::image::ImageCache; -#[cfg(feature = "layout-cache")] -use crate::layout::LayoutCache; -use crate::loading::Loader; - -/// Caches compilation artifacts. -pub struct Cache { - /// Caches parsed font faces. - pub font: FontCache, - /// Caches decoded images. - pub image: ImageCache, - /// Caches layouting artifacts. - #[cfg(feature = "layout-cache")] - pub layout: LayoutCache, -} - -impl Cache { - /// Create a new, empty cache. - pub fn new(loader: &dyn Loader) -> Self { - Self { - font: FontCache::new(loader), - image: ImageCache::new(), - #[cfg(feature = "layout-cache")] - layout: LayoutCache::new(), - } - } -} -- cgit v1.2.3