diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-20 20:21:56 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-21 11:28:29 +0200 |
| commit | 9488b1b850152eb564dbfefc898c962bdac73eb4 (patch) | |
| tree | 0a99487cddfee1a46b5802dc6b64c81b70e549da /src/cache.rs | |
| parent | 8000783f95ee007d9dda6f1dcc1c42c8e607b122 (diff) | |
Main context struct
Diffstat (limited to 'src/cache.rs')
| -rw-r--r-- | src/cache.rs | 30 |
1 files changed, 0 insertions, 30 deletions
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(), - } - } -} |
