Skip to main content

EmulatedDeviceType

Enum EmulatedDeviceType 

Source
#[repr(u8)]
pub enum EmulatedDeviceType {
Show 13 variants Dummy = 0, InterruptController = 1, Console = 2, IVCChannel = 10, GPPTRedistributor = 32, GPPTDistributor = 33, GPPTITS = 34, X86IoApic = 35, X86Pit = 36, PPPTGlobal = 48, VirtioBlk = 225, VirtioNet = 226, VirtioConsole = 227,
}
Expand description

The type of emulated device.

Allocation scheme:

  • 0x00 - 0x1F: Special devices, and abstract device types that does not specify a concrete interface or implementation. The device objects created from these types depend on the target architecture and the specific implementation of the hypervisor.
  • 0x20 - 0x7F: Concrete emulated device types.
    • 0x20 - 0x2F: Interrupt controller devices.
    • 0x30 - 0x3F: Reserved for future use.
  • 0x80 - 0xDF: Reserved for future use.
  • 0xE0 - 0xEF: Virtio devices.
  • 0xF0 - 0xFF: Reserved for future use.

Variants§

§

Dummy = 0

Dummy device type.

§

InterruptController = 1

Interrupt controller device, e.g. vGICv2 in aarch64, vLAPIC in x86.

§

Console = 2

Console (serial) device.

§

IVCChannel = 10

An emulated device that provides Inter-VM Communication (IVC) channel.

This device is used for communication between different VMs, the corresponding memory region of this device should be marked as Reserved in device tree or ACPI table.

§

GPPTRedistributor = 32

ARM GIC Partial Passthrough Redistributor device.

§

GPPTDistributor = 33

ARM GIC Partial Passthrough Distributor device.

§

GPPTITS = 34

ARM GIC Partial Passthrough Interrupt Translation Service device.

§

X86IoApic = 35

x86 virtual IO APIC device.

§

X86Pit = 36

x86 virtual PIT/8254 timer device.

§

PPPTGlobal = 48

RISC-V PLIC Partial Passthrough Global device.

§

VirtioBlk = 225

Virtio block device.

§

VirtioNet = 226

Virtio net device.

§

VirtioConsole = 227

Virtio console device.

Implementations§

Source§

impl EmulatedDeviceType

Source

pub const ALL: [Self; 13]

All known emulated device types.

Source

pub const fn all() -> &'static [Self]

Returns all known emulated device types.

Source

pub fn removable(&self) -> bool

Returns true if the device is removable.

Source

pub const fn from_usize(value: usize) -> Option<Self>

Converts a usize value to an EmulatedDeviceType.

Trait Implementations§

Source§

impl Clone for EmulatedDeviceType

Source§

fn clone(&self) -> EmulatedDeviceType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for EmulatedDeviceType

Source§

impl Debug for EmulatedDeviceType

Source§

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

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

impl Default for EmulatedDeviceType

Source§

fn default() -> EmulatedDeviceType

Returns the “default value” for a type. Read more
Source§

impl Display for EmulatedDeviceType

Source§

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

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

impl Eq for EmulatedDeviceType

Source§

impl PartialEq for EmulatedDeviceType

Source§

fn eq(&self, other: &EmulatedDeviceType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for EmulatedDeviceType

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.