pub type lv_cache_class_t = _lv_cache_class_t;Expand description
Cache class struct for building custom cache classes
Examples:
- lv_cache_class_lru_rb_count for LRU-based cache with count-based eviction policy.
- lv_cache_class_lru_rb_size for LRU-based cache with size-based eviction policy.
Aliased Type§
#[repr(C)]pub struct lv_cache_class_t {
pub alloc_cb: Option<unsafe extern "C" fn() -> *mut c_void>,
pub init_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t) -> bool>,
pub destroy_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *mut c_void)>,
pub get_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *const c_void, *mut c_void) -> *mut _lv_cache_entry_t>,
pub add_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *const c_void, *mut c_void) -> *mut _lv_cache_entry_t>,
pub remove_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *mut _lv_cache_entry_t, *mut c_void)>,
pub drop_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *const c_void, *mut c_void)>,
pub drop_all_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *mut c_void)>,
pub get_victim_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *mut c_void) -> *mut _lv_cache_entry_t>,
pub reserve_cond_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *const c_void, usize, *mut c_void) -> u32>,
pub iter_create_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t) -> *mut _lv_iter_t>,
}Fields§
§alloc_cb: Option<unsafe extern "C" fn() -> *mut c_void>< The allocation function for cache entries
init_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t) -> bool>< The initialization function for cache entries
destroy_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *mut c_void)>< The destruction function for cache entries
get_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *const c_void, *mut c_void) -> *mut _lv_cache_entry_t>< The get function for cache entries
add_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *const c_void, *mut c_void) -> *mut _lv_cache_entry_t>< The add function for cache entries
remove_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *mut _lv_cache_entry_t, *mut c_void)>< The remove function for cache entries
drop_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *const c_void, *mut c_void)>< The drop function for cache entries
drop_all_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *mut c_void)>< The drop all function for cache entries
get_victim_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *mut c_void) -> *mut _lv_cache_entry_t>< The get victim function for cache entries
reserve_cond_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t, *const c_void, usize, *mut c_void) -> u32>< The reserve condition function for cache entries
iter_create_cb: Option<unsafe extern "C" fn(*mut _lv_cache_t) -> *mut _lv_iter_t>< The iterator creation function for cache entries