heim_cpu/count.rs
1use heim_common::prelude::{Future, Result};
2
3use crate::sys;
4
5/// Returns future which will resolve into a amount of logical CPUs.
6pub fn logical_count() -> impl Future<Output = Result<u64>> {
7 sys::logical_count()
8}
9
10/// Returns future which will resolve into a amount of physical CPUs.
11///
12/// Returned future might resolve into `Ok(None)` if the amount can't be determined.
13pub fn physical_count() -> impl Future<Output = Result<Option<u64>>> {
14 sys::physical_count()
15}