pub struct ResourceClassCache<K: Hash + Eq, V, U: Default> {
    resources: FastHashMap<K, V>,
    pub user_data: U,
}

Fields§

§resources: FastHashMap<K, V>§user_data: U

Implementations§

source§

impl ResourceClassCache<GlyphKey, GlyphCacheEntry, GlyphKeyCacheInfo>

source

pub fn eviction_notice(&self) -> &EvictionNotice

source

fn clear_glyphs(&mut self)

source

pub fn add_glyph(&mut self, key: GlyphKey, value: GlyphCacheEntry)

source

fn clear_evicted(&mut self, texture_cache: &TextureCache)

source§

impl<K, V, U> ResourceClassCache<K, V, U>where K: Clone + Hash + Eq + Debug, U: Default,

source

pub fn new() -> Self

source

pub fn get(&self, key: &K) -> &V

source

pub fn try_get(&self, key: &K) -> Option<&V>

source

pub fn insert(&mut self, key: K, value: V)

source

pub fn remove(&mut self, key: &K) -> Option<V>

source

pub fn get_mut(&mut self, key: &K) -> &mut V

source

pub fn try_get_mut(&mut self, key: &K) -> Option<&mut V>

source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V>

source

pub fn iter(&self) -> Iter<'_, K, V>

source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

source

pub fn is_empty(&mut self) -> bool

source

pub fn clear(&mut self)

source

pub fn retain<F>(&mut self, f: F)where F: FnMut(&K, &mut V) -> bool,

Trait Implementations§

source§

impl<K, V, U> Serialize for ResourceClassCache<K, V, U>where K: Serialize + Hash + Eq, V: Serialize, U: Serialize + Default,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<K, V, U> RefUnwindSafe for ResourceClassCache<K, V, U>where K: RefUnwindSafe, U: RefUnwindSafe, V: RefUnwindSafe,

§

impl<K, V, U> Send for ResourceClassCache<K, V, U>where K: Send, U: Send, V: Send,

§

impl<K, V, U> Sync for ResourceClassCache<K, V, U>where K: Sync, U: Sync, V: Sync,

§

impl<K, V, U> Unpin for ResourceClassCache<K, V, U>where K: Unpin, U: Unpin, V: Unpin,

§

impl<K, V, U> UnwindSafe for ResourceClassCache<K, V, U>where K: UnwindSafe, U: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.