Type Alias libbpf_rs::OpenMapMut

source ·
pub type OpenMapMut<'obj> = OpenMapImpl<'obj, Mut>;
Expand description

A mutable parsed but not yet loaded BPF map.

Aliased Type§

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

Implementations§

source§

impl<'obj> OpenMapMut<'obj>

source

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

Create a new [OpenMapMut] from a ptr to a libbpf_sys::bpf_map.

source

pub fn initial_value_mut(&mut self) -> Option<&mut [u8]>

Retrieve the initial value of the map.

source

pub fn set_map_ifindex(&mut self, idx: u32)

source

pub fn set_initial_value(&mut self, data: &[u8]) -> Result<()>

source

pub fn set_type(&mut self, ty: MapType) -> Result<()>

source

pub fn set_key_size(&mut self, size: u32) -> Result<()>

source

pub fn set_value_size(&mut self, size: u32) -> Result<()>

source

pub fn set_max_entries(&mut self, count: u32) -> Result<()>

source

pub fn set_map_flags(&mut self, flags: u32) -> Result<()>

source

pub fn set_numa_node(&mut self, numa_node: u32) -> Result<()>

source

pub fn set_inner_map_fd(&mut self, inner_map_fd: BorrowedFd<'_>) -> Result<()>

source

pub fn set_map_extra(&mut self, map_extra: u64) -> Result<()>

source

pub fn set_autocreate(&mut self, autocreate: bool) -> Result<()>

source

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

source

pub fn reuse_fd(&mut self, fd: BorrowedFd<'_>) -> Result<()>

Reuse an fd for a BPF map

source

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

Reuse an already-pinned map for self.

Trait Implementations§

source§

impl<'obj> Deref for OpenMapMut<'obj>

§

type Target = OpenMapImpl<'obj>

The resulting type after dereferencing.
source§

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

Dereferences the value.