pub struct Program { /* private fields */ }
Implementations§
Source§impl Program
impl Program
Sourcepub fn create(
attr: &ProgramAttr,
instructions: &[u64],
log_out: Option<&mut dyn Write>,
) -> Result<Self, Error>
pub fn create( attr: &ProgramAttr, instructions: &[u64], log_out: Option<&mut dyn Write>, ) -> Result<Self, Error>
Creates a program with the given attributes and instructions. Optionally, an object implementing the Write trait can be passed in that receives the kernel eBPF logging output.
§Arguments
attr
- The program attributes.instructions
- The raw eBPF instructions describing the program.log_out
- The logger object.
Sourcepub fn get_attr(&self) -> &ProgramAttr
pub fn get_attr(&self) -> &ProgramAttr
Retrieves the attributes for the program.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Program
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
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