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
sourceimpl 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.
pub fn open_file<P: AsRef<Path>>(&mut self, path: P) -> Result<OpenObject>
pub fn open_memory<T: AsRef<str>>(
&mut self,
name: T,
mem: &[u8]
) -> Result<OpenObject>
Trait Implementations
sourceimpl Default for ObjectBuilder
impl Default for ObjectBuilder
sourcefn 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more