webrender::resource_cache

Struct ResourceClassCache

Source
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> Freeze for ResourceClassCache<K, V, U>
where U: Freeze,

§

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

§

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

§

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

§

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

§

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

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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.
Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.