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.