pub struct ActiveScope;Expand description
Currently active scope.
Implementations§
Source§impl ActiveScope
impl ActiveScope
Sourcepub unsafe fn set(scope: &Scope)
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.
Sourcepub unsafe fn set_pinned(scope: &Scope, pin: &CpuPin<'_>)
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.
Sourcepub unsafe fn set_global()
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.
Sourcepub unsafe fn set_global_pinned(pin: &CpuPin<'_>)
pub unsafe fn set_global_pinned(pin: &CpuPin<'_>)
Sourcepub fn is_global_pinned(pin: &CpuPin<'_>) -> bool
pub fn is_global_pinned(pin: &CpuPin<'_>) -> bool
Returns true if the active scope is global under an existing CPU pin.
Sourcepub fn is_pinned(scope: &Scope, pin: &CpuPin<'_>) -> bool
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.