pub struct EXAMPLE_PERCPU_DATA_WRAPPER {}
Expand description

Wrapper struct for the per-CPU data EXAMPLE_PERCPU_DATA

Implementations§

source§

impl EXAMPLE_PERCPU_DATA_WRAPPER

source

pub fn offset(&self) -> usize

Returns the offset relative to the per-CPU data area base on the current CPU.

source

pub unsafe fn current_ptr(&self) -> *const usize

Returns the raw pointer of this per-CPU data on the current CPU.

Safety

Caller must ensure that preemption is disabled on the current CPU.

source

pub unsafe fn current_ref_raw(&self) -> &usize

Returns the reference of the per-CPU data on the current CPU.

Safety

Caller must ensure that preemption is disabled on the current CPU.

source

pub unsafe fn current_ref_mut_raw(&self) -> &mut usize

Returns the mutable reference of the per-CPU data on the current CPU.

Safety

Caller must ensure that preemption is disabled on the current CPU.

source

pub fn with_current<F, T>(&self, f: F) -> T
where F: FnOnce(&mut usize) -> T,

Manipulate the per-CPU data on the current CPU in the given closure. Preemption will be disabled during the call.

source

pub unsafe fn read_current_raw(&self) -> usize

Returns the value of the per-CPU data on the current CPU.

Safety

Caller must ensure that preemption is disabled on the current CPU.

source

pub unsafe fn write_current_raw(&self, val: usize)

Set the value of the per-CPU data on the current CPU.

Safety

Caller must ensure that preemption is disabled on the current CPU.

source

pub fn read_current(&self) -> usize

Returns the value of the per-CPU data on the current CPU. Preemption will be disabled during the call.

source

pub fn write_current(&self, val: usize)

Set the value of the per-CPU data on the current CPU. Preemption will be disabled during the call.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.