Struct wr_glyph_rasterizer::FontTemplateMap
source · pub struct FontTemplateMap(Arc<RwLock<FastHashMap<FontKey, FontTemplate>>>);
Expand description
A map of font keys to font templates that might hold both namespace-local font templates as well as shared templates.
Tuple Fields§
§0: Arc<RwLock<FastHashMap<FontKey, FontTemplate>>>
Implementations§
source§impl FontTemplateMap
impl FontTemplateMap
pub fn new() -> Self
pub fn lock(&self) -> RwLockReadGuard<'_, FastHashMap<FontKey, FontTemplate>>
fn lock_mut( &mut self ) -> RwLockWriteGuard<'_, FastHashMap<FontKey, FontTemplate>>
pub fn clear(&mut self)
pub fn len(&self) -> usize
pub fn has_font(&self, key: &FontKey) -> bool
pub fn get_font(&self, key: &FontKey) -> Option<FontTemplate>
pub fn add_font(&mut self, key: FontKey, template: FontTemplate) -> bool
pub fn delete_font(&mut self, key: &FontKey) -> Option<FontTemplate>
pub fn delete_fonts(&mut self, keys: &[FontKey])
pub fn clear_namespace(&mut self, namespace: IdNamespace) -> Vec<FontKey>
Trait Implementations§
source§impl Clone for FontTemplateMap
impl Clone for FontTemplateMap
source§fn clone(&self) -> FontTemplateMap
fn clone(&self) -> FontTemplateMap
Returns a copy 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 RefUnwindSafe for FontTemplateMap
impl Send for FontTemplateMap
impl Sync for FontTemplateMap
impl Unpin for FontTemplateMap
impl UnwindSafe for FontTemplateMap
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more