diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -34,6 +34,8 @@ #[macro_use] pub mod util; #[macro_use] +pub mod memo; +#[macro_use] pub mod geom; #[macro_use] pub mod diag; @@ -45,13 +47,13 @@ pub mod frame; pub mod image; pub mod library; pub mod loading; -pub mod memo; pub mod model; pub mod parse; pub mod source; pub mod syntax; use std::collections::HashMap; +use std::hash::Hasher; use std::path::PathBuf; use std::sync::Arc; @@ -61,7 +63,8 @@ use crate::font::FontStore; use crate::frame::Frame; use crate::image::ImageStore; use crate::loading::Loader; -use crate::model::{PinBoard, StyleMap}; +use crate::memo::Track; +use crate::model::{PinBoard, PinConstraint, StyleMap}; use crate::source::{SourceId, SourceStore}; /// Typeset a source file into a collection of layouted frames. @@ -104,6 +107,18 @@ impl Context { } } +impl Track for &mut Context { + type Constraint = PinConstraint; + + fn key<H: Hasher>(&self, hasher: &mut H) { + self.pins.key(hasher); + } + + fn matches(&self, constraint: &Self::Constraint) -> bool { + self.pins.matches(constraint) + } +} + /// Compilation configuration. pub struct Config { /// The compilation root. |
