#[non_exhaustive]#[repr(C)]pub struct KvmNestedStateBuffer {
pub flags: u16,
pub format: u16,
pub size: u32,
pub hdr: kvm_nested_state__bindgen_ty_1,
pub data: kvm_nested_state__data,
}Available on x86-64 only.
Expand description
A stack-allocated buffer for nested KVM state including the mandatory header with meta-information.
KVM uses a dynamically sized buffer structure (with a header reporting the
size of the buffer/state). This helper type makes working with
get_nested_state() and set_nested_state() significantly more convenient
at the cost of a slightly higher memory footprint in some cases.
§Type Size
On Intel VMX, the actual state requires 128 + 8192 == 8320 bytes, on
AMD SVM, the actual state requires 128 + 4096 == 4224 bytes. This type
doesn’t make a differentiation and unifies the required memory. By
sacrificing a few more bytes on VMX, this type is generally convenient to
use.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.flags: u16§format: u16§size: u32§hdr: kvm_nested_state__bindgen_ty_1§data: kvm_nested_state__dataImplementations§
Trait Implementations§
Source§impl Clone for KvmNestedStateBuffer
impl Clone for KvmNestedStateBuffer
Source§fn clone(&self) -> KvmNestedStateBuffer
fn clone(&self) -> KvmNestedStateBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for KvmNestedStateBuffer
impl Default for KvmNestedStateBuffer
Source§impl<'de> Deserialize<'de> for KvmNestedStateBuffer
Available on crate feature serde only.
impl<'de> Deserialize<'de> for KvmNestedStateBuffer
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromBytes for KvmNestedStateBuffer
impl FromBytes for KvmNestedStateBuffer
Source§impl FromZeros for KvmNestedStateBuffer
impl FromZeros for KvmNestedStateBuffer
Source§impl IntoBytes for KvmNestedStateBufferwhere
u16: IntoBytes,
u32: IntoBytes,
kvm_nested_state__bindgen_ty_1: IntoBytes,
kvm_nested_state__data: IntoBytes,
(): PaddingFree<Self, { _ }>,
impl IntoBytes for KvmNestedStateBufferwhere
u16: IntoBytes,
u32: IntoBytes,
kvm_nested_state__bindgen_ty_1: IntoBytes,
kvm_nested_state__data: IntoBytes,
(): PaddingFree<Self, { _ }>,
Source§fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
Gets the bytes of this value mutably. Read more
Source§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§impl Serialize for KvmNestedStateBuffer
Available on crate feature serde only.
impl Serialize for KvmNestedStateBuffer
Available on crate feature
serde only.Source§impl TryFromBytes for KvmNestedStateBuffer
impl TryFromBytes for KvmNestedStateBuffer
Source§fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
Source§fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
Source§fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
impl Copy for KvmNestedStateBuffer
impl Immutable for KvmNestedStateBuffer
Auto Trait Implementations§
impl Freeze for KvmNestedStateBuffer
impl RefUnwindSafe for KvmNestedStateBuffer
impl Send for KvmNestedStateBuffer
impl Sync for KvmNestedStateBuffer
impl Unpin for KvmNestedStateBuffer
impl UnwindSafe for KvmNestedStateBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more