Skip to main content

TapBuilder

Struct TapBuilder 

Source
pub struct TapBuilder<E: Engine = LinearEngine> { /* private fields */ }
Expand description

Builder for a Tap.

Implementations§

Source§

impl<E: Engine> TapBuilder<E>

Source

pub fn new<I>(interface: I) -> Self
where I: TryInto<Interface>, I::Error: Into<Error>,

Creates a new TapBuilder from the given interface name or number.

Source

pub fn xdp_flags(self, xdp_flags: XdpFlags) -> Self

Set the XdpFlags.

Source

pub fn copy_config(self, copy_config: CopyConfig) -> Self

Set the CopyConfig.

Source

pub fn route_config(self, route_config: RouteConfig) -> Self

Set the RouteConfig.

Source

pub fn rule<R>(self, rule: R) -> Self
where R: TryInto<Rule, Error = RuleError>,

Chain a rule in a builder pattern.

Source

pub fn build(self) -> Result<Tap<E>, Error>

Builds the Tap.

§Errors

Returns Error::BuilderRule if a rule builder fails to build. Returns Error::InvalidInterfaceName or Error::InvalidInterfaceIndex if the interface provided is invalid. Returns Error::InvalidFrameKind if the interface does not use Eth or IP frames. May return additional Errors if the eBPF programs fail to load or attach.

Auto Trait Implementations§

§

impl<E> Freeze for TapBuilder<E>

§

impl<E = LinearEngine> !RefUnwindSafe for TapBuilder<E>

§

impl<E> Send for TapBuilder<E>
where E: Send,

§

impl<E> Sync for TapBuilder<E>
where E: Sync,

§

impl<E> Unpin for TapBuilder<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for TapBuilder<E>

§

impl<E = LinearEngine> !UnwindSafe for TapBuilder<E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.