pub struct Array<'a, T: Clone> { /* private fields */ }
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§
Source§impl<'base, T: Clone> Array<'base, T>
impl<'base, T: Clone> Array<'base, T>
Sourcepub fn set(&self, index: u32, value: T) -> Result<()>
pub fn set(&self, index: u32, value: T) -> Result<()>
Set value
into this array map at index
This method can fail if index
is out of bound
Auto Trait Implementations§
impl<'a, T> Freeze for Array<'a, T>
impl<'a, T> RefUnwindSafe for Array<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Array<'a, T>where
T: Send,
impl<'a, T> Sync for Array<'a, T>where
T: Sync,
impl<'a, T> Unpin for Array<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for Array<'a, T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more