pub struct PerCpuValues<T: Clone>(/* private fields */);
Expand description
A structure representing values of per-cpu map structures such as PerCpuArray
It is a kind of newtype of Box<[T]>
. The length of the slice is always
the same with cpus::get_possible_num
.
It also implements Deref
and DerefMut
so it can be used as a normal
array.
§Example
use redbpf::PerCpuValues;
let mut values = PerCpuValues::<u64>::new(0);
values[0] = 1;
Implementations§
Trait Implementations§
Source§impl<T: Clone + Clone> Clone for PerCpuValues<T>
impl<T: Clone + Clone> Clone for PerCpuValues<T>
Source§fn clone(&self) -> PerCpuValues<T>
fn clone(&self) -> PerCpuValues<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Clone> DerefMut for PerCpuValues<T>
impl<T: Clone> DerefMut for PerCpuValues<T>
Auto Trait Implementations§
impl<T> Freeze for PerCpuValues<T>
impl<T> RefUnwindSafe for PerCpuValues<T>where
T: RefUnwindSafe,
impl<T> Send for PerCpuValues<T>where
T: Send,
impl<T> Sync for PerCpuValues<T>where
T: Sync,
impl<T> Unpin for PerCpuValues<T>
impl<T> UnwindSafe for PerCpuValues<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