pub struct EbpfPtr<'a, T> { /* private fields */ }Expand description
Pointer to a buffer that may be shared between eBPF programs. It allows to safely pass around pointers to the data stored in eBPF maps and access the data referenced by the pointer.
Implementations§
Source§impl<'a, T> EbpfPtr<'a, T>
impl<'a, T> EbpfPtr<'a, T>
Sourcepub unsafe fn new(ptr: *mut T) -> Self
pub unsafe fn new(ptr: *mut T) -> Self
Creates a new EbpfPtr from the specified pointer.
§Safety
Caller must ensure that the buffer referenced by ptr is valid for
lifetime 'a.
Source§impl EbpfPtr<'_, u64>
impl EbpfPtr<'_, u64>
Sourcepub fn load_relaxed(&self) -> u64
pub fn load_relaxed(&self) -> u64
Loads the value referenced by the pointer. Atomicity is guaranteed if and only if the pointer is 8-byte aligned.
Sourcepub fn store_relaxed(&self, value: u64)
pub fn store_relaxed(&self, value: u64)
Stores the value at the memory referenced by the pointer. Atomicity
is guaranteed if and only if the pointer is 8-byte aligned.
Source§impl EbpfPtr<'_, u32>
impl EbpfPtr<'_, u32>
Sourcepub fn load_relaxed(&self) -> u32
pub fn load_relaxed(&self) -> u32
Loads the value referenced by the pointer. Atomicity is guaranteed if and only if the pointer is 8-byte aligned.
Sourcepub fn store_relaxed(&self, value: u32)
pub fn store_relaxed(&self, value: u32)
Stores the value at the memory referenced by the pointer. Atomicity
is guaranteed if and only if the pointer is 8-byte aligned.