pub struct CpuExecutionInfo { /* private fields */ }Expand description
Snapshot of the stable CPU execution contract and non-contractual provider diagnostics.
CpuBackendKind is the stable provider identity. The diagnostic string is
intended for logs and may change between builds or releases.
§Examples
use tenferro_cpu::{CpuBackend, CpuPlacement};
let info = CpuBackend::new().execution_info();
assert_eq!(info.requested_placement(), CpuPlacement::Auto);
assert!(!info.provider_diagnostic().is_empty());Implementations§
Source§impl CpuExecutionInfo
impl CpuExecutionInfo
Sourcepub fn backend_kind(&self) -> CpuBackendKind
pub fn backend_kind(&self) -> CpuBackendKind
Return the stable public provider identity.
§Examples
let info = tenferro_cpu::CpuBackend::new().execution_info();
assert_eq!(info.backend_kind(), tenferro_cpu::CpuBackend::new().kind());Sourcepub fn execution_mode(&self) -> CpuExecutionMode
pub fn execution_mode(&self) -> CpuExecutionMode
Return the stable execution-ownership mode.
§Examples
let mode = tenferro_cpu::CpuBackend::new()
.execution_info()
.execution_mode();
let _ = format!("{mode:?}");Sourcepub fn requested_placement(&self) -> CpuPlacement
pub fn requested_placement(&self) -> CpuPlacement
Return the placement requested by this backend handle.
§Examples
let info = tenferro_cpu::CpuBackend::new().execution_info();
assert_eq!(info.requested_placement(), tenferro_cpu::CpuPlacement::Auto);Sourcepub fn resolved_placement(&self) -> Option<&ResolvedCpuPlacement>
pub fn resolved_placement(&self) -> Option<&ResolvedCpuPlacement>
Return the concrete managed placement or external placement declaration.
§Examples
let backend = tenferro_cpu::CpuBackend::new();
let _managed = backend.execution_info().resolved_placement();Sourcepub fn topology(&self) -> &CpuTopology
pub fn topology(&self) -> &CpuTopology
Return the process-visible topology used for placement resolution.
§Examples
let info = tenferro_cpu::CpuBackend::new().execution_info();
assert!(!info.topology().allowed_cpus().is_empty());Sourcepub fn domain_id(&self) -> CpuDomainId
pub fn domain_id(&self) -> CpuDomainId
Return the coordinator-stable identity of the selected CPU domain.
§Examples
let id = tenferro_cpu::CpuBackend::new().execution_info().domain_id();
let _ = id.as_u64();Sourcepub fn domain_cpus(&self) -> &CpuSet
pub fn domain_cpus(&self) -> &CpuSet
Return the resolved or caller-declared logical CPUs of the selected domain.
§Examples
let info = tenferro_cpu::CpuBackend::new().execution_info();
assert!(!info.domain_cpus().is_empty());Sourcepub fn worker_count(&self) -> usize
pub fn worker_count(&self) -> usize
Return the worker count of the selected domain executor.
§Examples
let info = tenferro_cpu::CpuBackend::new().execution_info();
assert!(info.worker_count() >= 1);Sourcepub fn thread_budget(&self) -> usize
pub fn thread_budget(&self) -> usize
Return the maximum number of participating threads requested for this domain.
This can be smaller than Self::worker_count for an externally
supplied executor.
§Examples
let info = tenferro_cpu::CpuBackend::new().execution_info();
assert!(info.thread_budget() >= 1);
assert!(info.thread_budget() <= info.worker_count());Sourcepub fn placement_guarantee(&self) -> CpuPlacementGuarantee
pub fn placement_guarantee(&self) -> CpuPlacementGuarantee
Return whether the selected placement is exact or advisory.
§Examples
let guarantee = tenferro_cpu::CpuBackend::new()
.execution_info()
.placement_guarantee();
let _ = format!("{guarantee:?}");Sourcepub fn domain_ownership(&self) -> CpuDomainOwnership
pub fn domain_ownership(&self) -> CpuDomainOwnership
Return whether tenferro or the application owns the selected domain.
§Examples
let ownership = tenferro_cpu::CpuBackend::new()
.execution_info()
.domain_ownership();
let _ = format!("{ownership:?}");Sourcepub fn executor_affinity(&self) -> CpuExecutorAffinity
pub fn executor_affinity(&self) -> CpuExecutorAffinity
Return the selected executor’s worker-affinity claim.
§Examples
let affinity = tenferro_cpu::CpuBackend::new()
.execution_info()
.executor_affinity();
let _ = format!("{affinity:?}");Sourcepub fn executor_shutdown(&self) -> CpuExecutorShutdown
pub fn executor_shutdown(&self) -> CpuExecutorShutdown
Return who owns shutdown of the selected executor.
§Examples
let shutdown = tenferro_cpu::CpuBackend::new()
.execution_info()
.executor_shutdown();
let _ = format!("{shutdown:?}");Sourcepub fn provider_diagnostic(&self) -> &'static str
pub fn provider_diagnostic(&self) -> &'static str
Return a human-readable provider description for logs.
This string is diagnostic only and is not a provider identity contract.
§Examples
let diagnostic = tenferro_cpu::CpuBackend::new()
.execution_info()
.provider_diagnostic();
assert!(!diagnostic.is_empty());Trait Implementations§
Source§impl Clone for CpuExecutionInfo
impl Clone for CpuExecutionInfo
Source§fn clone(&self) -> CpuExecutionInfo
fn clone(&self) -> CpuExecutionInfo
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 CpuExecutionInfo
impl Debug for CpuExecutionInfo
Source§impl PartialEq for CpuExecutionInfo
impl PartialEq for CpuExecutionInfo
Source§fn eq(&self, other: &CpuExecutionInfo) -> bool
fn eq(&self, other: &CpuExecutionInfo) -> bool
self and other values to be equal, and is used by ==.impl Eq for CpuExecutionInfo
impl StructuralPartialEq for CpuExecutionInfo
Auto Trait Implementations§
impl Freeze for CpuExecutionInfo
impl RefUnwindSafe for CpuExecutionInfo
impl Send for CpuExecutionInfo
impl Sync for CpuExecutionInfo
impl Unpin for CpuExecutionInfo
impl UnsafeUnpin for CpuExecutionInfo
impl UnwindSafe for CpuExecutionInfo
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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