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
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.
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Array<'a, T> where
T: RefUnwindSafe,
impl<'a, T> UnwindSafe for Array<'a, T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
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