pub struct FontEnvironment { /* private fields */ }Expand description
A frozen content environment with an explicit cache identity. The content package owns its concrete font implementation; core only carries its immutable snapshot and never initializes a font engine.
Implementations§
Source§impl FontEnvironment
impl FontEnvironment
Sourcepub fn new<T: Any + Send + Sync>(value: T, identity: u64) -> Self
pub fn new<T: Any + Send + Sync>(value: T, identity: u64) -> Self
Captures an immutable environment under its owning implementation’s identity.
Sourcepub fn snapshot_id(&self) -> u64
pub fn snapshot_id(&self) -> u64
Stable identity of this immutable environment snapshot.
Sourcepub fn with_usage(
self,
usage: impl Fn() -> Vec<FontIdentity> + Send + Sync + 'static,
) -> Self
pub fn with_usage( self, usage: impl Fn() -> Vec<FontIdentity> + Send + Sync + 'static, ) -> Self
Attaches explicit usage reporting without exposing the content engine to core.
Sourcepub fn used_fonts(&self) -> Vec<FontIdentity>
pub fn used_fonts(&self) -> Vec<FontIdentity>
Faces actually selected from this shared environment, including source hashes.
Sourcepub fn downcast_ref<T: Any>(&self) -> Option<&T>
pub fn downcast_ref<T: Any>(&self) -> Option<&T>
Resolves an environment only in the package that owns its concrete type.
Trait Implementations§
Source§impl Clone for FontEnvironment
impl Clone for FontEnvironment
Source§impl Debug for FontEnvironment
impl Debug for FontEnvironment
Source§impl From<&FontEnvironment> for FontEnvironment
impl From<&FontEnvironment> for FontEnvironment
Source§fn from(value: &FontEnvironment) -> Self
fn from(value: &FontEnvironment) -> Self
Converts to this type from the input type.
impl RefUnwindSafe for FontEnvironment
impl UnwindSafe for FontEnvironment
Auto Trait Implementations§
impl Forget for FontEnvironment
impl Freeze for FontEnvironment
impl Move for FontEnvironment
impl Send for FontEnvironment
impl Sync for FontEnvironment
impl Unpin for FontEnvironment
impl UnsafeUnpin for FontEnvironment
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