pub struct IccCache { /* private fields */ }Expand description
Per-document cache of ICCBased profile streams → compiled transforms,
keyed by the profile stream’s object id AND the rendering intent (the same
profile may be requested under different intents on one page). Failures are
cached as None so a malformed profile is parsed (and warned about) once.
Implementations§
Source§impl IccCache
impl IccCache
pub fn new() -> IccCache
Sourcepub fn get_or_build(
&mut self,
id: ObjectId,
intent: RenderIntent,
data: impl FnOnce() -> Option<Vec<u8>>,
) -> Option<Arc<IccTransform>>
pub fn get_or_build( &mut self, id: ObjectId, intent: RenderIntent, data: impl FnOnce() -> Option<Vec<u8>>, ) -> Option<Arc<IccTransform>>
The cached transform for profile stream id under intent, building it
from the bytes returned by data on first use. data returning None
(unresolvable stream) also caches as a failure.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for IccCache
impl !UnwindSafe for IccCache
impl Freeze for IccCache
impl Send for IccCache
impl Sync for IccCache
impl Unpin for IccCache
impl UnsafeUnpin for IccCache
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