Skip to main content

CpuExecutionInfo

Struct CpuExecutionInfo 

Source
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

Source

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());
Source

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:?}");
Source

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);
Source

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();
Source

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());
Source

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();
Source

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());
Source

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);
Source

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());
Source

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:?}");
Source

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:?}");
Source

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:?}");
Source

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:?}");
Source

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

Source§

fn clone(&self) -> CpuExecutionInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CpuExecutionInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CpuExecutionInfo

Source§

fn eq(&self, other: &CpuExecutionInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for CpuExecutionInfo

Source§

impl StructuralPartialEq for CpuExecutionInfo

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
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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

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.
§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSendSync for T
where T: Send + Sync,

§

impl<T> MaybeSync for T
where T: Sync,