pub struct OpenObject { /* private fields */ }
Expand description
Represents an opened (but not yet loaded) BPF object file.
Use this object to access OpenMap
s and OpenProgram
s.
Implementations§
Source§impl OpenObject
impl OpenObject
Sourcepub unsafe fn from_ptr(ptr: NonNull<bpf_object>) -> Self
pub unsafe fn from_ptr(ptr: NonNull<bpf_object>) -> Self
Takes ownership from pointer.
§Safety
Operations on the returned object are undefined if ptr
is any one of:
- null
- points to an unopened bpf_object
- points to a loaded bpf_object
It is not safe to manipulate ptr
after this operation.
Sourcepub fn take_ptr(self) -> NonNull<bpf_object>
pub fn take_ptr(self) -> NonNull<bpf_object>
Takes underlying libbpf_sys::bpf_object
pointer.
Sourcepub fn maps(&self) -> impl Iterator<Item = OpenMap<'_>>
pub fn maps(&self) -> impl Iterator<Item = OpenMap<'_>>
Retrieve an iterator over all BPF maps in the object.
Sourcepub fn maps_mut(&mut self) -> impl Iterator<Item = OpenMapMut<'_>>
pub fn maps_mut(&mut self) -> impl Iterator<Item = OpenMapMut<'_>>
Retrieve an iterator over all BPF maps in the object.
Sourcepub fn progs(&self) -> impl Iterator<Item = OpenProgram<'_>>
pub fn progs(&self) -> impl Iterator<Item = OpenProgram<'_>>
Retrieve an iterator over all BPF programs in the object.
Sourcepub fn progs_mut(&mut self) -> impl Iterator<Item = OpenProgramMut<'_>>
pub fn progs_mut(&mut self) -> impl Iterator<Item = OpenProgramMut<'_>>
Retrieve an iterator over all BPF programs in the object.
Trait Implementations§
Source§impl AsRawLibbpf for OpenObject
impl AsRawLibbpf for OpenObject
Source§fn as_libbpf_object(&self) -> NonNull<Self::LibbpfType>
fn as_libbpf_object(&self) -> NonNull<Self::LibbpfType>
Retrieve the underlying libbpf_sys::bpf_object
.
Source§type LibbpfType = bpf_object
type LibbpfType = bpf_object
The underlying
libbpf
type.Source§impl Debug for OpenObject
impl Debug for OpenObject
Auto Trait Implementations§
impl Freeze for OpenObject
impl RefUnwindSafe for OpenObject
impl !Send for OpenObject
impl !Sync for OpenObject
impl Unpin for OpenObject
impl UnwindSafe for OpenObject
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