pub struct TcHookBuilder<'fd> { /* private fields */ }
Expand description
Builds TcHook
instances.
TcHookBuilder
is a way to ergonomically create multiple TcHook
s,
all with similar initial values.
Once a TcHook
is created via the Self::hook()
method, the TcHook
’s values can still
be adjusted before TcHook::attach()
is called.
Implementations§
Source§impl<'fd> TcHookBuilder<'fd>
impl<'fd> TcHookBuilder<'fd>
Sourcepub fn new(fd: BorrowedFd<'fd>) -> Self
pub fn new(fd: BorrowedFd<'fd>) -> Self
Create a new TcHookBuilder
with fd
this fd should come from a loaded 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 TcHook
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§
Auto Trait Implementations§
impl<'fd> Freeze for TcHookBuilder<'fd>
impl<'fd> RefUnwindSafe for TcHookBuilder<'fd>
impl<'fd> Send for TcHookBuilder<'fd>
impl<'fd> Sync for TcHookBuilder<'fd>
impl<'fd> Unpin for TcHookBuilder<'fd>
impl<'fd> UnwindSafe for TcHookBuilder<'fd>
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