#[repr(transparent)]struct FontCell {
unsafe_self_cell: UnsafeSelfCell<FontCell, Arc<dyn AsRef<[u8]> + Send + Sync>, DependentFontData<'static>>,
}Fields§
§unsafe_self_cell: UnsafeSelfCell<FontCell, Arc<dyn AsRef<[u8]> + Send + Sync>, DependentFontData<'static>>Implementations§
Source§impl FontCell
impl FontCell
Sourcefn new(
owner: Arc<dyn AsRef<[u8]> + Send + Sync>,
dependent_builder: impl for<'_q> FnOnce(&'_q Arc<dyn AsRef<[u8]> + Send + Sync>) -> DependentFontData<'_q>,
) -> Self
fn new( owner: Arc<dyn AsRef<[u8]> + Send + Sync>, dependent_builder: impl for<'_q> FnOnce(&'_q Arc<dyn AsRef<[u8]> + Send + Sync>) -> DependentFontData<'_q>, ) -> Self
Constructs a new self-referential struct.
The provided owner will be moved into a heap allocated box. Followed by construction
of the dependent value, by calling dependent_builder with a shared reference to the
owner that remains valid for the lifetime of the constructed struct.
Sourcefn try_new<Err>(
owner: Arc<dyn AsRef<[u8]> + Send + Sync>,
dependent_builder: impl for<'_q> FnOnce(&'_q Arc<dyn AsRef<[u8]> + Send + Sync>) -> Result<DependentFontData<'_q>, Err>,
) -> Result<Self, Err>
fn try_new<Err>( owner: Arc<dyn AsRef<[u8]> + Send + Sync>, dependent_builder: impl for<'_q> FnOnce(&'_q Arc<dyn AsRef<[u8]> + Send + Sync>) -> Result<DependentFontData<'_q>, Err>, ) -> Result<Self, Err>
Constructs a new self-referential struct or returns an error.
Consumes owner on error.
Sourcefn try_new_or_recover<Err>(
owner: Arc<dyn AsRef<[u8]> + Send + Sync>,
dependent_builder: impl for<'_q> FnOnce(&'_q Arc<dyn AsRef<[u8]> + Send + Sync>) -> Result<DependentFontData<'_q>, Err>,
) -> Result<Self, (Arc<dyn AsRef<[u8]> + Send + Sync>, Err)>
fn try_new_or_recover<Err>( owner: Arc<dyn AsRef<[u8]> + Send + Sync>, dependent_builder: impl for<'_q> FnOnce(&'_q Arc<dyn AsRef<[u8]> + Send + Sync>) -> Result<DependentFontData<'_q>, Err>, ) -> Result<Self, (Arc<dyn AsRef<[u8]> + Send + Sync>, Err)>
Constructs a new self-referential struct or returns an error.
Returns owner and error as tuple on error.
Sourcefn with_dependent<'outer_fn, Ret>(
&'outer_fn self,
func: impl for<'_q> FnOnce(&'_q Arc<dyn AsRef<[u8]> + Send + Sync>, &'outer_fn DependentFontData<'_q>) -> Ret,
) -> Ret
fn with_dependent<'outer_fn, Ret>( &'outer_fn self, func: impl for<'_q> FnOnce(&'_q Arc<dyn AsRef<[u8]> + Send + Sync>, &'outer_fn DependentFontData<'_q>) -> Ret, ) -> Ret
Calls given closure func with a shared reference to dependent.
Sourcefn with_dependent_mut<'outer_fn, Ret>(
&'outer_fn mut self,
func: impl for<'_q> FnOnce(&'_q Arc<dyn AsRef<[u8]> + Send + Sync>, &'outer_fn mut DependentFontData<'_q>) -> Ret,
) -> Ret
fn with_dependent_mut<'outer_fn, Ret>( &'outer_fn mut self, func: impl for<'_q> FnOnce(&'_q Arc<dyn AsRef<[u8]> + Send + Sync>, &'outer_fn mut DependentFontData<'_q>) -> Ret, ) -> Ret
Calls given closure func with an unique reference to dependent.
Sourcefn borrow_dependent<'_q>(&'_q self) -> &'_q DependentFontData<'_q>
fn borrow_dependent<'_q>(&'_q self) -> &'_q DependentFontData<'_q>
Borrows dependent.
Source§impl FontCell
impl FontCell
fn px_scale_factor(&self, scale: f32) -> f32
fn allocate_glyph_uncached( &mut self, atlas: &mut TextureAtlas, metrics: &StyledMetrics, glyph_info: &GlyphInfo, bin: SubpixelBin, location: LocationRef<'_>, ) -> Option<GlyphAllocation>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FontCell
impl !RefUnwindSafe for FontCell
impl Send for FontCell
impl Sync for FontCell
impl Unpin for FontCell
impl !UnwindSafe for FontCell
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