pub enum OwnedFontSource {
Memory(FcFont),
Disk(FcFontPath),
}Expand description
Owned font-source descriptor, returned by
FcFontCache::get_font_by_id.
In v4.0 this was a borrowed enum (FontSource<'a> with refs into
the pattern map). With v4.1’s shared-state cache, the map lives
behind an RwLock, so returning a reference would require the
caller to hold a read guard for the full lifetime of the result —
which bleeds the locking strategy into every call site. The owned
variant clones the small FcFont / FcFontPath struct and
releases the lock immediately. Bytes/mmap are not cloned — those
go through get_font_bytes which hands out Arc<FontBytes>.
Variants§
Memory(FcFont)
Font loaded from memory (small metadata + owned Vec<u8>).
Disk(FcFontPath)
Font loaded from disk.
Trait Implementations§
Source§impl Clone for OwnedFontSource
impl Clone for OwnedFontSource
Source§fn clone(&self) -> OwnedFontSource
fn clone(&self) -> OwnedFontSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OwnedFontSource
impl RefUnwindSafe for OwnedFontSource
impl Send for OwnedFontSource
impl Sync for OwnedFontSource
impl Unpin for OwnedFontSource
impl UnsafeUnpin for OwnedFontSource
impl UnwindSafe for OwnedFontSource
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