pub struct EquationCache { /* private fields */ }Expand description
The laid-out form of an equation’s LaTeX source. It is derived data: rebuilt by
EquationCache::refresh whenever the source changes, never saved, and ignored when shapes
are compared. Painters read it and never lay equations out themselves, so nothing in a paint
path can reach the layout engine.
An entry answers only for the source it was built from, compared in full: a hash match alone
is not enough, so two sources whose hashes collide never share a layout. A source over
crate::math::MAX_SOURCE_BYTES never lays out, so EquationCache::get answers for it
by its length alone, with crate::math::SOURCE_TOO_LONG, and an entry built from one holds
neither the source nor its hash: a painter asking every frame about a source of megabytes read
from a file does no work on it.
Implementations§
Source§impl EquationCache
impl EquationCache
Sourcepub fn get(&self, src: &str) -> Option<Result<&MathList, &MathError>>
pub fn get(&self, src: &str) -> Option<Result<&MathList, &MathError>>
The layout of src, or why it has none; None until EquationCache::refresh has run
for this source. A source over crate::math::MAX_SOURCE_BYTES is answered at once,
whatever the entry holds, by its length alone.
Trait Implementations§
Source§impl Clone for EquationCache
impl Clone for EquationCache
Source§fn clone(&self) -> EquationCache
fn clone(&self) -> EquationCache
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more