MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / cache

Method cache

src/renderer.rs:360–363  ·  view source on GitHub ↗
(&mut self, key: String, value: impl Into<TextureOwner>)

Source from the content-addressed store, hash-verified

358 /// Cache a value with the given key. Accepts `Texture2D` or `RenderTarget`.
359 #[allow(private_bounds)]
360 pub fn cache(&mut self, key: String, value: impl Into<TextureOwner>) -> &Texture2D {
361 self.textures.insert(key.clone(), CacheEntry { frames_not_used: 0, owner: value.into() });
362 self.textures.get(&key).unwrap().owner.texture()
363 }
364
365 pub fn clean(&mut self) {
366 self.textures.retain(|_, entry| entry.frames_not_used <= self.max_frames_not_used);

Callers 1

renderFunction · 0.80

Calls 3

cloneMethod · 0.80
textureMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected