pub struct SkeletonBuilder { /* private fields */ }
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()
    .source("myobject.bpf.c")
    .debug(true)
    .clang("/opt/clang/clang")
    .build_and_generate("/output/path")
    .unwrap();

Implementations

Point the SkeletonBuilder to a source file for compilation

Default is None

Point the SkeletonBuilder to an object file for generation

Default is None

Turn debug output on or off

Default is off

Specify which clang binary to use

Default searchs $PATH for clang

Pass additional arguments to clang when buildling BPF object file

Examples
use libbpf_cargo::SkeletonBuilder;

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

Specify whether or not to skip clang version check

Default is false

Specify which rustfmt binary to use

Default searches $PATH for rustfmt

Build BPF programs and generate the skeleton at path output

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.