#[repr(C)]pub struct FontRef {
pub parsed: *const c_void,
pub copies: *const AtomicUsize,
pub run_destructor: bool,
pub parsed_destructor: FontRefDestructorCallbackType,
}Expand description
FontRef is a reference-counted pointer to a parsed font. It holds a *const c_void that points to the actual parsed font data (typically a ParsedFont from the layout crate).
The parsed data is managed via atomic reference counting, allowing safe sharing across threads without duplicating the font data.
Fields§
§parsed: *const c_voidPointer to the parsed font data (e.g., ParsedFont)
copies: *const AtomicUsizeReference counter for memory management
run_destructor: boolWhether to run the destructor on drop
parsed_destructor: FontRefDestructorCallbackTypeDestructor function for the parsed data
Implementations§
Source§impl FontRef
impl FontRef
Sourcepub fn new(
parsed: *const c_void,
destructor: FontRefDestructorCallbackType,
) -> Self
pub fn new( parsed: *const c_void, destructor: FontRefDestructorCallbackType, ) -> Self
Create a new FontRef from parsed font data
§Arguments
parsed- Pointer to parsed font data (e.g., Arc::into_raw(Arc::new(ParsedFont)))destructor- Function to clean up the parsed data
Sourcepub fn get_parsed(&self) -> *const c_void
pub fn get_parsed(&self) -> *const c_void
Get a raw pointer to the parsed font data
Trait Implementations§
Source§impl Ord for FontRef
impl Ord for FontRef
Source§impl PartialOrd for FontRef
impl PartialOrd for FontRef
impl Eq for FontRef
impl Send for FontRef
impl Sync for FontRef
Auto Trait Implementations§
impl Freeze for FontRef
impl RefUnwindSafe for FontRef
impl Unpin for FontRef
impl UnwindSafe for FontRef
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