Skip to main content

PlatformX86

Struct PlatformX86 

Source
pub struct PlatformX86 { /* private fields */ }
Expand description

The x86 specific platform properties for a virtual machine.

Reference to the official documentation:

https://www.virtualbox.org/sdkref/interface_i_platform_x86.html

Implementations§

Source§

impl PlatformX86

Source

pub fn get_hpet_enabled(&self) -> Result<bool, VboxError>

This attribute controls if High Precision Event Timer (HPET) is enabled in this VM.

§Returns

Returns bool on success, or a VboxError on failure.

§Example

use virtualbox_rs::VirtualBox;

let vbox = VirtualBox::init().unwrap();
let machine = vbox.
        find_machines("Freebsd_14").unwrap();
let platform = machine.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
let hpet_enabled = platform_x86.get_hpet_enabled().unwrap();
Source

pub fn set_hpet_enabled(&self, hpet_enabled: bool) -> Result<(), VboxError>

This attribute controls if High Precision Event Timer (HPET) is enabled in this VM.

§Arguments
  • hpet_enabled - This attribute controls if High Precision Event Timer (HPET) is enabled in this VM.
§Returns

Returns () on success, or a VboxError on failure.

§Example

use virtualbox_rs::{Session, VirtualBox};
use virtualbox_rs::enums::SessionType;

let vbox = VirtualBox::init().unwrap();
let machine = vbox.
        find_machines("Freebsd_14").unwrap();
let mut session = Session::init().unwrap();
machine.lock_machine(&mut session, SessionType::Shared).unwrap();
let machine_mut = session.get_machine().unwrap();
let platform = machine_mut.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
platform_x86.set_hpet_enabled(true).unwrap();
Source

pub fn get_cpu_property( &self, property: CPUPropertyType, ) -> Result<bool, VboxError>

Returns the virtual CPU boolean value of the specified property.

§Arguments
§Returns

Returns bool success, or a VboxError on failure.

§Example

use virtualbox_rs::{VirtualBox};
use virtualbox_rs::enums::CPUPropertyType;

let vbox = VirtualBox::init().unwrap();
let machine = vbox.
        find_machines("Freebsd_14").unwrap();
let platform = machine.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
let cpu_property = platform_x86.get_cpu_property(CPUPropertyType::APIC).unwrap();
Source

pub fn set_cpu_property( &self, property: CPUPropertyType, value: bool, ) -> Result<(), VboxError>

Sets the virtual CPU boolean value of the specified property.

§Arguments
  • property - CPUPropertyType. Property type to query.
  • value - bool. Property value.
§Returns

Returns () success, or a VboxError on failure.

§Example

use virtualbox_rs::{Session, VirtualBox};
use virtualbox_rs::enums::{CPUPropertyType, SessionType};

let vbox = VirtualBox::init().unwrap();
let machine = vbox.
        find_machines("Freebsd_14").unwrap();
let mut session = Session::init().unwrap();
machine.lock_machine(&mut session, SessionType::Shared).unwrap();
let machine_mut = session.get_machine().unwrap();
let platform = machine_mut.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
platform_x86.set_cpu_property(CPUPropertyType::APIC, true).unwrap();
Source

pub fn get_hw_virt_ex_property( &self, property: HWVirtExPropertyType, ) -> Result<bool, VboxError>

Returns the value of the specified hardware virtualization boolean property.

§Arguments
§Returns

Returns bool success, or a VboxError on failure.

§Example

use virtualbox_rs::{VirtualBox};
use virtualbox_rs::enums::HWVirtExPropertyType;

let vbox = VirtualBox::init().unwrap();
let machine = vbox.
        find_machines("Freebsd_14").unwrap();
let platform = machine.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
let property = platform_x86.get_hw_virt_ex_property(HWVirtExPropertyType::NestedPaging).unwrap();
Source

pub fn set_hw_virt_ex_property( &self, property: HWVirtExPropertyType, value: bool, ) -> Result<(), VboxError>

Sets a new value for the specified hardware virtualization boolean property.

§Arguments
§Returns

Returns () success, or a VboxError on failure.

§Example

use virtualbox_rs::{Session, VirtualBox};
use virtualbox_rs::enums::{HWVirtExPropertyType, SessionType};

let vbox = VirtualBox::init().unwrap();
let machine = vbox.
        find_machines("Freebsd_14").unwrap();
let mut session = Session::init().unwrap();
machine.lock_machine(&mut session, SessionType::Shared).unwrap();
let machine_mut = session.get_machine().unwrap();
let platform = machine_mut.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
platform_x86.set_hw_virt_ex_property(HWVirtExPropertyType::NestedPaging, true).unwrap();

Trait Implementations§

Source§

impl Debug for PlatformX86

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PlatformX86

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for PlatformX86

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.