pub struct SimpleCounter { /* private fields */ }Expand description
Per-thread, per-object simple counters
Implementations§
Source§impl SimpleCounter
impl SimpleCounter
Sourcepub fn allocate_index(
&self,
_vm: &BarrierHeldMainRef,
index: u32,
) -> SimpleCounterIndex<'_>
pub fn allocate_index( &self, _vm: &BarrierHeldMainRef, index: u32, ) -> SimpleCounterIndex<'_>
Allocate the given index for use, zeroing it in the process
This is similar to the VPP C API vlib_validate_simple_counter.
Note that no checks are performed to ensure that the index isn’t already in use, but it doesn’t result in unsoundness if the same value is allocated for an already-allocated and not dropped index.
Trait Implementations§
Source§impl Drop for SimpleCounter
impl Drop for SimpleCounter
impl Send for SimpleCounter
impl Sync for SimpleCounter
Auto Trait Implementations§
impl Freeze for SimpleCounter
impl RefUnwindSafe for SimpleCounter
impl Unpin for SimpleCounter
impl UnsafeUnpin for SimpleCounter
impl UnwindSafe for SimpleCounter
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