pub struct CpuExecutionContext<'a> { /* private fields */ }Expand description
Borrowed execution policy for an already-entered CPU operation.
The context exposes immutable domain facts while keeping the resource lease, executor object, and the checked executor-entry boundary private. Providers cannot install or submit work through this value.
§Examples
Providers inspect this value inside a trait method:
use tenferro_cpu::provider::CpuExecutionContext;
assert!(context.thread_budget().get() >= 1);Implementations§
Source§impl<'a> CpuExecutionContext<'a>
impl<'a> CpuExecutionContext<'a>
Sourcepub fn domain_id(&self) -> CpuDomainId
pub fn domain_id(&self) -> CpuDomainId
Return the stable identity of the selected CPU resource domain.
§Examples
use tenferro_cpu::CpuExecutionContext;
let _domain_id = context.domain_id();Sourcepub fn cpus(&self) -> &CpuSet
pub fn cpus(&self) -> &CpuSet
Return the selected domain’s declared logical CPU set.
§Examples
use tenferro_cpu::CpuExecutionContext;
assert!(!context.cpus().is_empty());Sourcepub fn thread_budget(&self) -> NonZeroUsize
pub fn thread_budget(&self) -> NonZeroUsize
Return the non-zero maximum participating-thread budget.
§Examples
use tenferro_cpu::CpuExecutionContext;
assert!(context.thread_budget().get() >= 1);Sourcepub fn placement_guarantee(&self) -> CpuPlacementGuarantee
pub fn placement_guarantee(&self) -> CpuPlacementGuarantee
Return the strength of the selected domain’s placement guarantee.
§Examples
use tenferro_cpu::CpuExecutionContext;
let _guarantee = context.placement_guarantee();Sourcepub fn parallel_mode(&self) -> ParallelMode
pub fn parallel_mode(&self) -> ParallelMode
Return the engine-selected scheduling mode for this entered provider call.
Provider calls observe Sequential or Inner. Outer scheduling creates a separate Sequential context inside every submitted child.
§Examples
use tenferro_cpu::{CpuExecutionContext, ParallelMode};
assert!(matches!(
context.parallel_mode(),
ParallelMode::Sequential | ParallelMode::Inner
));Trait Implementations§
Source§impl<'a> Clone for CpuExecutionContext<'a>
impl<'a> Clone for CpuExecutionContext<'a>
Source§fn clone(&self) -> CpuExecutionContext<'a>
fn clone(&self) -> CpuExecutionContext<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CpuExecutionContext<'_>
impl Debug for CpuExecutionContext<'_>
impl<'a> Copy for CpuExecutionContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for CpuExecutionContext<'a>
impl<'a> !RefUnwindSafe for CpuExecutionContext<'a>
impl<'a> Send for CpuExecutionContext<'a>
impl<'a> Sync for CpuExecutionContext<'a>
impl<'a> Unpin for CpuExecutionContext<'a>
impl<'a> UnsafeUnpin for CpuExecutionContext<'a>
impl<'a> !UnwindSafe for CpuExecutionContext<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more