Skip to main content

EmuDeviceType

Enum EmuDeviceType 

Source
#[repr(u8)]
pub enum EmuDeviceType { Dummy = 0, InterruptController = 1, Console = 2, IVCChannel = 10, GPPTRedistributor = 32, GPPTDistributor = 33, GPPTITS = 34, 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.

§

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

Implementation of methods for EmulatedDeviceType.

Source

pub fn removable(&self) -> bool

Returns true if the device is removable.

Source

pub fn from_usize(value: usize) -> EmulatedDeviceType

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 Debug for EmulatedDeviceType

Source§

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

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<'de> Deserialize<'de> for EmulatedDeviceType

Source§

fn deserialize<D>( deserializer: D, ) -> Result<EmulatedDeviceType, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for EmulatedDeviceType

Source§

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

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

impl Enumerable for EmulatedDeviceType

Source§

const ENUMERABLE_SIZE_OPTION: Option<usize>

The number of elements in this enumerable wrapped in Option::Some if it does not exceed usize::MAX, None otherwise. Read more
Source§

type Enumerator = Copied<Iter<'static, EmulatedDeviceType>>

The type of the iterator that will be returned by the enumerator method.
Source§

fn enumerator() -> <EmulatedDeviceType as Enumerable>::Enumerator

Return an iterator over all possible values of the implementing type.
Source§

const ENUMERABLE_SIZE: usize = _

The number of elements in this enumerable. If the number exceeds the usize::MAX, accessing this constant fails at compile time. Read more
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 Serialize for EmulatedDeviceType

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for EmulatedDeviceType

Source§

impl Eq for EmulatedDeviceType

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,