Struct sixtyfps_corelib::item_rendering::CachedRenderingData [−][src]
#[repr(C)]pub struct CachedRenderingData { /* fields omitted */ }
Expand description
This structure must be present in items that are Rendered and contains information. Used by the backend.
Implementations
pub fn ensure_up_to_date<T: Clone>(
&self,
cache: &mut RenderingCache<T>,
update_fn: impl FnOnce() -> T
) -> T
pub fn ensure_up_to_date<T: Clone>(
&self,
cache: &mut RenderingCache<T>,
update_fn: impl FnOnce() -> T
) -> T
This function allows retrieving the backend specific per-item data cache, updating it if depending properties have changed. The supplied update_fn will be called when properties have changed or the cache is initialized the first time.
This function can be used to remove an entry from the rendering cache for a given item, if it exists, i.e. if any data was ever cached. This is typically called by the graphics backend’s implementation of the release_item_graphics_cache function.
Trait Implementations
Returns the “default value” for a type. Read more