Struct libbpf_rs::TcHookBuilder
source · [−]pub struct TcHookBuilder { /* private fields */ }
Expand description
A TcHookBuilder is a way to ergonomically create multiple TcHooks All with similar initial values
Once a TcHook is created via the hook() method, the TcHook’s values can still be adjusted before attach() is called
Implementations
sourceimpl TcHookBuilder
impl TcHookBuilder
pub fn new() -> Self
sourcepub fn fd(&mut self, fd: i32) -> &mut Self
pub fn fd(&mut self, fd: i32) -> &mut Self
Set the initial file descriptor for created hooks this fd should come from a loaded libbpf_rs::Program
sourcepub fn ifindex(&mut self, ifindex: i32) -> &mut Self
pub fn ifindex(&mut self, ifindex: i32) -> &mut Self
Set the initial interface index to attach the hook on
sourcepub fn replace(&mut self, replace: bool) -> &mut Self
pub fn replace(&mut self, replace: bool) -> &mut Self
Set whether created hooks should replace existing hooks
sourcepub fn hook(&self, attach_point: TcAttachPoint) -> TcHook
pub fn hook(&self, attach_point: TcAttachPoint) -> TcHook
Create a Hook given the values previously set
Once a hook is created, the values can still be changed on the TcHook by calling the TcHooks setter methods
Trait Implementations
sourceimpl Debug for TcHookBuilder
impl Debug for TcHookBuilder
sourceimpl Default for TcHookBuilder
impl Default for TcHookBuilder
sourcefn default() -> TcHookBuilder
fn default() -> TcHookBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for TcHookBuilder
impl Send for TcHookBuilder
impl Sync for TcHookBuilder
impl Unpin for TcHookBuilder
impl UnwindSafe for TcHookBuilder
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