[][src]Struct redbpf::Map

pub struct Map {
    pub name: String,
    pub kind: u32,
    // some fields omitted
}

Maps are loaded automatically, so you normally do not have to do anything to initialise them after loading an ELF file.

The Map structure provides a safe wrapper around the native calls, but do take and return VoidPtr arguments.

On top of this, maps do not need to be mutable to be mutated, since the underlying code does not require such guarrantees.

This design makes it easier to deal with maps, and keeps them versatile for sharing data between the kernel and userspace, however, it remains a foot cannon. In the future, this might need more work.

Fields

name: Stringkind: u32

Methods

impl Map[src]

pub fn load(name: &str, code: &[u8]) -> Result<Map>[src]

pub fn set(&self, key: VoidPtr, value: VoidPtr)[src]

pub fn get(&self, key: VoidPtr, value: VoidPtr)[src]

pub fn delete(&self, key: VoidPtr)[src]

Auto Trait Implementations

impl Send for Map

impl Sync for Map

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.