pub struct OpenMap { /* private fields */ }
Expand description
Represents a parsed but not yet loaded BPF map.
This object exposes operations that need to happen before the map is created.
Some methods require working with raw bytes. You may find libraries such as
plain
helpful.
Implementations§
source§impl OpenMap
impl OpenMap
sourcepub fn initial_value(&self) -> Option<&[u8]>
pub fn initial_value(&self) -> Option<&[u8]>
Retrieve the initial value of the map.
sourcepub fn initial_value_mut(&mut self) -> Option<&mut [u8]>
pub fn initial_value_mut(&mut self) -> Option<&mut [u8]>
Retrieve the initial value of the map.
pub fn set_map_ifindex(&mut self, idx: u32)
pub fn set_initial_value(&mut self, data: &[u8]) -> Result<()>
pub fn set_type(&mut self, ty: MapType) -> Result<()>
pub fn set_key_size(&mut self, size: u32) -> Result<()>
pub fn set_value_size(&mut self, size: u32) -> Result<()>
pub fn set_max_entries(&mut self, count: u32) -> Result<()>
pub fn set_map_flags(&mut self, flags: u32) -> Result<()>
pub fn set_numa_node(&mut self, numa_node: u32) -> Result<()>
pub fn set_inner_map_fd(&mut self, inner: &Map)
pub fn set_map_extra(&mut self, map_extra: u64) -> Result<()>
pub fn set_autocreate(&mut self, autocreate: bool) -> Result<()>
pub fn set_pin_path<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
sourcepub fn reuse_fd(&self, fd: BorrowedFd<'_>) -> Result<()>
pub fn reuse_fd(&self, fd: BorrowedFd<'_>) -> Result<()>
Reuse an fd for a BPF map
Trait Implementations§
source§impl AsRawLibbpf for OpenMap
impl AsRawLibbpf for OpenMap
source§fn as_libbpf_object(&self) -> NonNull<Self::LibbpfType>
fn as_libbpf_object(&self) -> NonNull<Self::LibbpfType>
Retrieve the underlying libbpf_sys::bpf_map
.
§type LibbpfType = bpf_map
type LibbpfType = bpf_map
The underlying
libbpf
type.Auto Trait Implementations§
impl Freeze for OpenMap
impl RefUnwindSafe for OpenMap
impl !Send for OpenMap
impl !Sync for OpenMap
impl Unpin for OpenMap
impl UnwindSafe for OpenMap
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