Type Alias hypervisor::kvm::x86_64::KvmCpuId

source ·
type KvmCpuId = FlexibleArrayWrapper<kvm_cpuid2, kvm_cpuid_entry2>;

Aliased Type§

struct KvmCpuId {
    entries: Vec<kvm_cpuid2>,
    phantom: PhantomData<kvm_cpuid_entry2>,
    allocated_len: usize,
}

Fields§

§entries: Vec<kvm_cpuid2>§phantom: PhantomData<kvm_cpuid_entry2>§allocated_len: usize

Implementations

source§

impl<T, S> FlexibleArrayWrapper<T, S>
where T: FlexibleArray<S> + Default,

Convenience wrapper for flexible array structs.

The FlexibleArray trait must be implemented for the flexible array struct before using this wrapper.

source

pub fn new(array_len: usize) -> FlexibleArrayWrapper<T, S>

Creates a new FlexibleArrayWrapper for the given flexible array struct type and flexible array type. The flexible array length is set to array_len. vec_with_array_field is used to make sure the resultant wrapper is appropriately sized.

source

pub fn entries_slice(&self) -> &[S]

Returns a slice of the flexible array member, for inspecting. To modify, use mut_entries_slice instead.

source

pub fn mut_entries_slice(&mut self) -> &mut [S]

Returns a mutable slice of the flexible array member, for modifying.

source

pub fn as_ptr(&self) -> *const T

Get a pointer so it can be passed to the kernel. Callers must not access the flexible array member. Using this pointer is unsafe.

source

pub fn as_mut_ptr(&mut self) -> *mut T

Get a mutable pointer so it can be passed to the kernel. Callers must not access the flexible array member. Using this pointer is unsafe.

Trait Implementations