[][src]Struct libbpf_rs::OpenObject

pub struct OpenObject { /* fields omitted */ }

Represents an opened (but not yet loaded) BPF object file.

Use this object to access OpenMaps and OpenPrograms.

Implementations

impl OpenObject[src]

pub unsafe fn from_ptr(ptr: *mut bpf_object) -> Self[src]

Takes ownership from pointer.

Safety

If ptr is unopen or already loaded then further operations on the returned object are undefined.

It is not safe to manipulate ptr after this operation.

pub fn take_ptr(self) -> *mut bpf_object[src]

Takes underlying libbpf_sys::bpf_object pointer.

pub fn name<'a>(&'a self) -> Result<&'a str>[src]

pub fn map<T: AsRef<str>>(&mut self, name: T) -> Result<Option<&mut OpenMap>>[src]

pub fn map_unwrap<T: AsRef<str>>(&mut self, name: T) -> &mut OpenMap[src]

Same as OpenObject::map except will panic if Err or None is encountered.

pub fn prog<T: AsRef<str>>(
    &mut self,
    name: T
) -> Result<Option<&mut OpenProgram>>
[src]

pub fn prog_unwrap<T: AsRef<str>>(&mut self, name: T) -> &mut OpenProgram[src]

Same as OpenObject::prog except will panic if Err or None is encountered.

pub fn load(self) -> Result<Object>[src]

Load the maps and programs contained in this BPF object into the system.

Trait Implementations

impl Drop for OpenObject[src]

Auto Trait Implementations

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.