Struct libbpf_cargo::SkeletonBuilder[][src]

pub struct SkeletonBuilder { /* fields omitted */ }
Expand description

SkeletonBuilder builds and generates a single skeleton.

This interface is meant to be used in build scripts.

Examples

use libbpf_cargo::SkeletonBuilder;

SkeletonBuilder::new("myobject.bpf.c")
    .debug(true)
    .clang("/opt/clang/clang")
    .generate("/output/path")
    .unwrap();

Implementations

impl SkeletonBuilder[src]

pub fn new<P: AsRef<Path>>(source: P) -> Self[src]

Create a new builder instance, where source is the path to the BPF object source (typically suffixed by .bpf.c)

pub fn debug(&mut self, debug: bool) -> &mut SkeletonBuilder[src]

Turn debug output on or off

Default is off

pub fn clang<P: AsRef<Path>>(&mut self, clang: P) -> &mut SkeletonBuilder[src]

Specify which clang binary to use

Default searchs $PATH for clang

pub fn clang_args<S: AsRef<str>>(&mut self, opts: S) -> &mut SkeletonBuilder[src]

Pass additional arguments to clang when buildling BPF object file

Examples

use libbpf_cargo::SkeletonBuilder;

SkeletonBuilder::new("myobject.bpf.c")
    .clang_args("-DMACRO=value -I/some/include/dir")
    .generate("/output/path")
    .unwrap();

pub fn skip_clang_version_check(&mut self, skip: bool) -> &mut SkeletonBuilder[src]

Specify whether or not to skip clang version check

Default is false

pub fn rustfmt<P: AsRef<Path>>(&mut self, rustfmt: P) -> &mut SkeletonBuilder[src]

Specify which rustfmt binary to use

Default searches $PATH for rustfmt

pub fn generate<P: AsRef<Path>>(&self, output: P) -> Result<()>[src]

Generate the skeleton at path output

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V