Skip to main content

ActiveScope

Struct ActiveScope 

Source
pub struct ActiveScope;
Expand description

Currently active scope.

Implementations§

Source§

impl ActiveScope

Source

pub unsafe fn set(scope: &Scope)

Sets the active scope pointer to the given scope.

§Safety

The caller must ensure that the provided scope reference is valid for the duration in which it is set as the active scope, and that no data races or aliasing violations occur.

Source

pub unsafe fn set_pinned(scope: &Scope, pin: &CpuPin<'_>)

Sets the active scope while borrowing an existing CPU pin.

This variant performs no context transition and is therefore suitable for scheduler and hard-IRQ code that already owns a pin.

§Safety

The caller must keep scope alive for every current-CPU access until a later Self::set_global_pinned or pinned replacement, and must prevent concurrent mutable access to that scope’s items.

Source

pub unsafe fn set_global()

Set the active scope to the global scope.

§Safety

The caller must own the current raw activation. In particular, this function must not clear a scheduler-managed ScopeCell activation; that activation must be released through ScopeCell::deactivate_pinned.

Source

pub unsafe fn set_global_pinned(pin: &CpuPin<'_>)

Sets the active scope to the global scope under an existing CPU pin.

§Safety

The caller must own the current raw activation and must not bypass a scheduler-managed ScopeCell activation.

Source

pub fn is_global() -> bool

Returns true if the active scope is the global scope.

Source

pub fn is_global_pinned(pin: &CpuPin<'_>) -> bool

Returns true if the active scope is global under an existing CPU pin.

Source

pub fn is_pinned(scope: &Scope, pin: &CpuPin<'_>) -> bool

Returns whether scope is the active scope selected by pin.

This does not acquire a scope lease. Callers must already own the scheduler or task-local serialization that keeps the selected scope alive and excludes mutation for the duration of their operation.

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.