Struct glommio::CpuSet [−][src]
pub struct CpuSet(_);
Expand description
Used to specify a set of permitted CPUs on which
executors created by a
LocalExecutorPoolBuilder
are run.
Please see the documentation for Placement
variants to
understand how CpuSet
restrictions apply to each variant. CPUs are
identified via their CpuLocation
.
Implementations
Creates a CpuSet
representing all CPUs that are online.
The function will return an Err
if the hardware topology could not
be obtained from this machine.
This method can be used to restrict the CPUs held by CpuSet
. The
resulting CpuSet
will only include CpuLocation
s for which the
provided closure returns true
. Note that each call to filter
will use as input the set of CPUs previously selected (i.e. the set is
not reset on each call).
use glommio::CpuSet; // get CPUs on NUMA node 0 let cpus = CpuSet::online() .expect("Err: please file an issue with glommio") .filter(|l| l.numa_node == 0); println!("The filtered CPUs are: {:#?}", cpus);
Returns a reference to the CpuLocation
s currently included in the
CpuSet
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CpuSet
impl UnwindSafe for CpuSet
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more