VMClockShmHeader

Struct VMClockShmHeader 

Source
#[repr(C)]
pub struct VMClockShmHeader { pub magic: AtomicU32, pub size: AtomicU32, pub version: AtomicU16, pub counter_id: AtomicU8, pub time_type: AtomicU8, pub seq_count: AtomicU32, }
Expand description

Header structure to the Shared Memory segment where the VMClock data is kept.

Most members are atomic types as they are subject to be updated by the Hypervisor.

Fields§

§magic: AtomicU32

Magic number to uniquely identify the content of the memory segment.

§size: AtomicU32

Size of the memory segment.

§version: AtomicU16

Version identifying the layout of data written to the shared memory segment.

§counter_id: AtomicU8

Counter ID.

§time_type: AtomicU8

Time type.

Possible values are:

VMCLOCK_TIME_UTC 0 // Since 1970-01-01 00:00:00z VMCLOCK_TIME_TAI 1 // Since 1970-01-01 00:00:00z VMCLOCK_TIME_MONOTONIC 2 // Since undefined epoch VMCLOCK_TIME_INVALID_SMEARED 3 // Not supported VMCLOCK_TIME_INVALID_MAYBE_SMEARED 4 // Not supported

§seq_count: AtomicU32

Implementations§

Source§

impl VMClockShmHeader

Source

pub fn read(vector: &Vec<u8>) -> Result<Self, ShmError>

Initialize a VMClockShmHeader from a vector of bytes.

It is assumed that the vecxtor has already been validated to have enough bytes to hold.

Trait Implementations§

Source§

impl Debug for VMClockShmHeader

Source§

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

Formats the value using the given formatter. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more