Struct redbpf::Array[][src]

pub struct Array<'a, T: Clone> { /* fields omitted */ }
Expand description

Array map corresponding to BPF_MAP_TYPE_ARRAY

Example

use redbpf::{load::Loader, Array};
let loaded = Loader::load(b"biolatpcts.elf").expect("error loading BPF program");
let biolat = Array::<u64>::new(loaded.map("biolat").expect("arr not found")).expect("error creating Array in userspace");
let v = biolat.get(0).unwrap();

This structure is used by userspace programs. For BPF program’s API, see redbpf_probes::maps::Array

Implementations

Create Array map from base

Set value into this array map at index

This method can fail if index is out of bound

Get an element at index from this array map

This method always returns a Some(T) if index is valid, but None can be returned if index is out of bound.

Get length of this array map.

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more