pub trait HostIf {
// Required method
fn get_host_cpu_num() -> usize;
}Expand description
The API trait for host system functionalities.
This trait defines the interface for querying host system information. Implementations should be provided by the host system or HAL layer.
Required Methods§
Sourcefn get_host_cpu_num() -> usize
fn get_host_cpu_num() -> usize
Get the total number of CPUs (logical processors) in the host system.
This function returns the number of CPUs available to the hypervisor, which is typically the same as the number of physical or logical processors in the system.
§Returns
The number of CPUs in the host system.
§Example
ⓘ
let cpu_count = axvisor_api::host::get_host_cpu_num();
println!("Host has {} CPUs", cpu_count);Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".