Struct libbpf_rs::Object[][src]

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

Represents a loaded BPF object file.

An Object is logically in charge of all the contained Programs and Maps as well as the associated metadata and runtime state that underpins the userspace portions of BPF program execution. As a libbpf-rs user, you must keep the Object alive during the entire lifetime of your interaction with anything inside the Object.

Note that this is an explanation of the motivation – Rust’s lifetime system should already be enforcing this invariant.

Implementations

Takes ownership from pointer.

Safety

If ptr is not already loaded then further operations on the returned object are undefined.

It is not safe to manipulate ptr after this operation.

Get a reference to Map with the name name, if one exists.

Get a mutable reference to Map with the name name, if one exists.

Get an iterator over references to all Maps. Note that this will include automatically generated .data, .rodata, .bss, and .kconfig maps. You may wish to filter this.

Get an iterator over mutable references to all Maps. Note that this will include automatically generated .data, .rodata, .bss, and .kconfig maps. You may wish to filter this.

Get a reference to Program with the name name, if one exists.

Get a mutable reference to Program with the name name, if one exists.

Get an iterator over references to all Programs.

Get an iterator over mutable references to all Programs.

Trait Implementations

Executes the destructor for this 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

Performs the conversion.

Performs the conversion.

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.