Struct libbpf_rs::OpenObject [−][src]
Represents an opened (but not yet loaded) BPF object file.
Use this object to access OpenMap
s and OpenProgram
s.
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]
&mut self,
name: T
) -> Result<Option<&mut OpenProgram>>
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
impl RefUnwindSafe for OpenObject
impl !Send for OpenObject
impl !Sync for OpenObject
impl Unpin for OpenObject
impl UnwindSafe for OpenObject
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,