pub struct ArrayOfMaps<T, V = MapData> { /* private fields */ }Expand description
An array of eBPF maps.
An ArrayOfMaps stores references to other eBPF maps.
§Minimum kernel version
The minimum kernel version required to use this feature is 4.12.
Implementations§
Source§impl<T: Borrow<MapData>, V> ArrayOfMaps<T, V>
impl<T: Borrow<MapData>, V> ArrayOfMaps<T, V>
Source§impl<T: Borrow<MapData>, V: FromMapData> ArrayOfMaps<T, V>
impl<T: Borrow<MapData>, V: FromMapData> ArrayOfMaps<T, V>
Sourcepub fn get(&self, index: &u32, flags: u64) -> Result<V, MapError>
pub fn get(&self, index: &u32, flags: u64) -> Result<V, MapError>
Returns the inner map stored at the given index.
The inner map type V is determined by the type parameter on the
ArrayOfMaps itself.
§File descriptor cost
Each call opens a new file descriptor to the inner map. The caller owns the returned map and its FD is closed on drop. Avoid calling this in a tight loop without dropping previous results.
§Errors
Returns MapError::OutOfBounds if index is out of bounds, MapError::SyscallError
if bpf_map_lookup_elem fails.
Trait Implementations§
Source§impl<T: Debug, V> Debug for ArrayOfMaps<T, V>
impl<T: Debug, V> Debug for ArrayOfMaps<T, V>
Auto Trait Implementations§
impl<T, V> Freeze for ArrayOfMaps<T, V>where
T: Freeze,
impl<T, V> RefUnwindSafe for ArrayOfMaps<T, V>where
T: RefUnwindSafe,
V: RefUnwindSafe,
impl<T, V> Send for ArrayOfMaps<T, V>
impl<T, V> Sync for ArrayOfMaps<T, V>
impl<T, V> Unpin for ArrayOfMaps<T, V>
impl<T, V> UnsafeUnpin for ArrayOfMaps<T, V>where
T: UnsafeUnpin,
impl<T, V> UnwindSafe for ArrayOfMaps<T, V>where
T: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more