Struct wr_glyph_rasterizer::FontContexts
source · pub struct FontContexts {
worker_contexts: Vec<Mutex<FontContext>>,
workers: Arc<ThreadPool>,
locked_mutex: Mutex<bool>,
locked_cond: Condvar,
}
Fields§
§worker_contexts: Vec<Mutex<FontContext>>
§workers: Arc<ThreadPool>
§locked_mutex: Mutex<bool>
§locked_cond: Condvar
Implementations§
source§impl FontContexts
impl FontContexts
sourcepub fn lock_current_context(&self) -> MutexGuard<'_, FontContext>
pub fn lock_current_context(&self) -> MutexGuard<'_, FontContext>
Get access to the font context associated to the current thread.
pub(crate) fn current_worker_id(&self) -> Option<usize>
source§impl FontContexts
impl FontContexts
sourcepub fn lock_context(&self, id: usize) -> MutexGuard<'_, FontContext>
pub fn lock_context(&self, id: usize) -> MutexGuard<'_, FontContext>
Get access to any particular font context.
The id is an index between 0 and num_worker_contexts for font contexts associated to the thread pool.
pub fn lock_any_context(&self) -> MutexGuard<'_, FontContext>
pub fn num_worker_contexts(&self) -> usize
Auto Trait Implementations§
impl !RefUnwindSafe for FontContexts
impl Send for FontContexts
impl Sync for FontContexts
impl Unpin for FontContexts
impl !UnwindSafe for FontContexts
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