#[non_exhaustive]pub enum KernelValueWidth {
U32,
U64,
Bytes(usize),
}Expand description
Width specifier for the Op::ReadKernelHot /
Op::ReadKernelCold ops — picks which
crate::monitor::guest::GuestKernel
read_*_u32 / read_*_u64 / read_*_bytes family the host
dispatcher invokes for the read. Mirrors KernelValue’s
variant tags but without payload data (reads do not carry an
outgoing value — only a width hint that the dispatcher uses to
size the resulting crate::vmm::wire::KernelOpValue in the
reply).
§#[non_exhaustive]
KernelValueWidth is #[non_exhaustive] so new widths can be
added without breaking external pattern-matchers. Prefer the
per-variant constructors (Self::u32, Self::u64,
Self::bytes) over naming variant literals.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
U32
Read a u32 little-endian. Atomic when the resolved host
PA is 4-byte aligned (see KernelValue::U32’s alignment
note for the misaligned fall-through behaviour).
U64
Read a u64 little-endian. Atomic at 8-byte alignment;
otherwise a per-byte loop is used (same fall-through as
KernelValue::U64).
Bytes(usize)
Read exactly len raw bytes. Non-atomic; reads through the
crate::monitor::guest::GuestKernel read_*_bytes
helpers’ chunked-page primitive.
Implementations§
Trait Implementations§
Source§impl Clone for KernelValueWidth
impl Clone for KernelValueWidth
Source§fn clone(&self) -> KernelValueWidth
fn clone(&self) -> KernelValueWidth
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KernelValueWidth
impl Debug for KernelValueWidth
Source§impl From<&KernelValueWidth> for KernelOpValue
impl From<&KernelValueWidth> for KernelOpValue
Source§fn from(width: &KernelValueWidth) -> Self
fn from(width: &KernelValueWidth) -> Self
Map a KernelValueWidth to a zero-filled
crate::vmm::wire::KernelOpValue of the requested width
for the read-entry’s value-hint slot. The wire payload’s
value discriminant tells the host dispatcher which read
family to invoke; the byte contents are written by the
host before replying.
Source§impl PartialEq for KernelValueWidth
impl PartialEq for KernelValueWidth
impl Eq for KernelValueWidth
impl StructuralPartialEq for KernelValueWidth
Auto Trait Implementations§
impl Freeze for KernelValueWidth
impl RefUnwindSafe for KernelValueWidth
impl Send for KernelValueWidth
impl Sync for KernelValueWidth
impl Unpin for KernelValueWidth
impl UnwindSafe for KernelValueWidth
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more