Struct i_slint_core::item_rendering::CachedRenderingData
source · [−]#[repr(C)]pub struct CachedRenderingData { /* private fields */ }
Expand description
This structure must be present in items that are Rendered and contains information. Used by the backend.
Implementations
sourceimpl CachedRenderingData
impl CachedRenderingData
sourcepub fn get_or_update<T: Clone>(
&self,
cache: &RefCell<RenderingCache<T>>,
update_fn: impl FnOnce() -> T
) -> T
pub fn get_or_update<T: Clone>(
&self,
cache: &RefCell<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.
sourcepub fn release<T>(&self, cache: &mut RenderingCache<T>) -> Option<T>
pub fn release<T>(&self, cache: &mut RenderingCache<T>) -> Option<T>
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.
sourcepub fn get_entry<'a, T>(
&self,
cache: &'a mut RenderingCache<T>
) -> Option<&'a mut CachedGraphicsData<T>>
pub fn get_entry<'a, T>(
&self,
cache: &'a mut RenderingCache<T>
) -> Option<&'a mut CachedGraphicsData<T>>
Return the value if it is in the cache
Trait Implementations
sourceimpl Debug for CachedRenderingData
impl Debug for CachedRenderingData
sourceimpl Default for CachedRenderingData
impl Default for CachedRenderingData
sourcefn default() -> CachedRenderingData
fn default() -> CachedRenderingData
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for CachedRenderingData
impl Send for CachedRenderingData
impl !Sync for CachedRenderingData
impl Unpin for CachedRenderingData
impl UnwindSafe for CachedRenderingData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more