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 CpuLocations 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 CpuLocations currently included in the CpuSet.

Checks whether the CpuSet is empty.

Returns the number of CPUs included in the CpuSet.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more