pub struct LruPerCpuHashMap<K, V> { /* private fields */ }Implementations§
Source§impl<K, V> LruPerCpuHashMap<K, V>
impl<K, V> LruPerCpuHashMap<K, V>
pub const fn with_max_entries( max_entries: u32, flags: u32, ) -> LruPerCpuHashMap<K, V>
pub const fn pinned(max_entries: u32, flags: u32) -> LruPerCpuHashMap<K, V>
Sourcepub unsafe fn get(&self, key: &K) -> Option<&V>
pub unsafe fn get(&self, key: &K) -> Option<&V>
Retrieve the value associate with key from the map.
This function is unsafe. Unless the map flag BPF_F_NO_PREALLOC is used, the kernel does not
make guarantee on the atomicity of insert or remove, and any element removed from the
map might get aliased by another element in the map, causing garbage to be read, or
corruption in case of writes.
Sourcepub fn get_ptr(&self, key: &K) -> Option<*const V>
pub fn get_ptr(&self, key: &K) -> Option<*const V>
Retrieve the value associate with key from the map.
The same caveat as get applies, but this returns a raw pointer and it’s up to the caller
to decide whether it’s safe to dereference the pointer or not.
Sourcepub fn get_ptr_mut(&self, key: &K) -> Option<*mut V>
pub fn get_ptr_mut(&self, key: &K) -> Option<*mut V>
Retrieve the value associate with key from the map.
The same caveat as get applies, and additionally cares should be taken to avoid
concurrent writes, but it’s up to the caller to decide whether it’s safe to dereference the
pointer or not.