pub struct HashMap<T, K, V> { /* private fields */ }Expand description
A hash map that can be shared between eBPF programs and user space.
§Minimum kernel version
The minimum kernel version required to use this feature is 3.19.
§Examples
use aya::maps::HashMap;
let mut redirect_ports = HashMap::try_from(bpf.map_mut("REDIRECT_PORTS").unwrap())?;
// redirect port 80 to 8080
redirect_ports.insert(80, 8080, 0);
// redirect port 443 to 8443
redirect_ports.insert(443, 8443, 0);Implementations§
Source§impl<T: Borrow<MapData>, K: Pod, V: Pod> HashMap<T, K, V>
impl<T: Borrow<MapData>, K: Pod, V: Pod> HashMap<T, K, V>
Trait Implementations§
Auto Trait Implementations§
impl<T, K, V> Freeze for HashMap<T, K, V>where
T: Freeze,
impl<T, K, V> RefUnwindSafe for HashMap<T, K, V>
impl<T, K, V> Send for HashMap<T, K, V>
impl<T, K, V> Sync for HashMap<T, K, V>
impl<T, K, V> Unpin for HashMap<T, K, V>
impl<T, K, V> UnsafeUnpin for HashMap<T, K, V>where
T: UnsafeUnpin,
impl<T, K, V> UnwindSafe for HashMap<T, K, V>
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