libbpf_rs

Type Alias MapMut

Source
pub type MapMut<'obj> = MapImpl<'obj, Mut>;
Expand description

A mutable loaded BPF map.

Aliased Type§

struct MapMut<'obj> { /* private fields */ }

Implementations§

Source§

impl<'obj> MapMut<'obj>

Source

pub fn new_mut(map: &'obj mut bpf_map) -> Self

Create a MapMut from a libbpf_sys::bpf_map.

Source

pub fn pin<P: AsRef<Path>>(&mut self, path: P) -> Result<()>

Pin this map to bpffs.

Source

pub fn unpin<P: AsRef<Path>>(&mut self, path: P) -> Result<()>

Unpin this map from bpffs.

Source

pub fn attach_struct_ops(&mut self) -> Result<Link>

Attach a struct ops map

Methods from Deref<Target = Map<'obj>>§

Source

pub fn is_pinned(&self) -> bool

Returns whether map is pinned or not flag

Source

pub fn get_pin_path(&self) -> Option<&OsStr>

Returns the pin_path if the map is pinned, otherwise, None is returned

Trait Implementations§

Source§

impl<'obj> Deref for MapMut<'obj>

Source§

type Target = MapImpl<'obj>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.