Struct libbpf_rs::ObjectBuilder
source · pub struct ObjectBuilder { /* private fields */ }
Expand description
Builder for creating an OpenObject
. Typically the entry point into libbpf-rs.
Implementations§
source§impl ObjectBuilder
impl ObjectBuilder
sourcepub fn name<T: AsRef<str>>(&mut self, name: T) -> &mut Self
pub fn name<T: AsRef<str>>(&mut self, name: T) -> &mut Self
Override the generated name that would have been inferred from the constructor.
sourcepub fn relaxed_maps(&mut self, relaxed_maps: bool) -> &mut Self
pub fn relaxed_maps(&mut self, relaxed_maps: bool) -> &mut Self
Option to parse map definitions non-strictly, allowing extra attributes/data
sourcepub fn debug(&mut self, dbg: bool) -> &mut Self
pub fn debug(&mut self, dbg: bool) -> &mut Self
Option to print debug output to stderr.
Note: This function uses set_print
internally and will overwrite any callbacks
currently in use.
sourcepub fn opts(&mut self, name: *const c_char) -> bpf_object_open_opts
pub fn opts(&mut self, name: *const c_char) -> bpf_object_open_opts
Get an instance of libbpf_sys::bpf_object_open_opts.
sourcepub fn open_file<P: AsRef<Path>>(&mut self, path: P) -> Result<OpenObject>
pub fn open_file<P: AsRef<Path>>(&mut self, path: P) -> Result<OpenObject>
Open an object using the provided path on the file system.
sourcepub fn open_memory<T: AsRef<str>>(
&mut self,
name: T,
mem: &[u8]
) -> Result<OpenObject>
pub fn open_memory<T: AsRef<str>>( &mut self, name: T, mem: &[u8] ) -> Result<OpenObject>
Open an object from memory.
Trait Implementations§
source§impl Debug for ObjectBuilder
impl Debug for ObjectBuilder
source§impl Default for ObjectBuilder
impl Default for ObjectBuilder
source§fn default() -> ObjectBuilder
fn default() -> ObjectBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ObjectBuilder
impl Send for ObjectBuilder
impl Sync for ObjectBuilder
impl Unpin for ObjectBuilder
impl UnwindSafe for ObjectBuilder
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