pub struct AffinityConfig {
pub enabled: bool,
pub cores: Vec<usize>,
pub mode: AffinityMode,
}Expand description
CPU core affinity configuration.
Fields§
§enabled: boolEnable core pinning
cores: Vec<usize>Specific cores to use (empty = all available)
mode: AffinityModeAffinity mode
Implementations§
Source§impl AffinityConfig
impl AffinityConfig
Sourcepub fn mode(self, mode: AffinityMode) -> Self
pub fn mode(self, mode: AffinityMode) -> Self
Set affinity mode.
Sourcepub fn core_for_worker(&self, worker_id: usize) -> usize
pub fn core_for_worker(&self, worker_id: usize) -> usize
Get the core to pin a worker to based on worker ID.
Trait Implementations§
Source§impl Clone for AffinityConfig
impl Clone for AffinityConfig
Source§fn clone(&self) -> AffinityConfig
fn clone(&self) -> AffinityConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AffinityConfig
impl Debug for AffinityConfig
Auto Trait Implementations§
impl Freeze for AffinityConfig
impl RefUnwindSafe for AffinityConfig
impl Send for AffinityConfig
impl Sync for AffinityConfig
impl Unpin for AffinityConfig
impl UnwindSafe for AffinityConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging