pub struct FontKey(pub &'static str);Expand description
Opaque handle for a font. lightweight-pdf-core never sees font bytes, only this
key (see plan/00a-contracts-and-artifacts.md, point 3).
serde (issue #17): deserializes from a plain JSON string. Since the
wrapped &'static str can’t borrow from a transient JSON buffer, each
distinct name deserialized is leaked (Box::leak) to get a 'static
reference — one small, permanent allocation per distinct font-key name
ever seen in a document, acceptable for “parse a document, render it,
done” but not for a long-running process parsing unbounded distinct
names in a hot loop.
Tuple Fields§
§0: &'static strImplementations§
Trait Implementations§
impl Copy for FontKey
impl Eq for FontKey
Source§impl Ord for FontKey
impl Ord for FontKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for FontKey
impl PartialOrd for FontKey
impl StructuralPartialEq for FontKey
Auto Trait Implementations§
impl Freeze for FontKey
impl RefUnwindSafe for FontKey
impl Send for FontKey
impl Sync for FontKey
impl Unpin for FontKey
impl UnsafeUnpin for FontKey
impl UnwindSafe for FontKey
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