[][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 RefUnwindSafe for Map

impl Send for Map

impl Sync for Map

impl Unpin for Map

impl UnwindSafe for Map

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.