VolatilityStruct

Struct VolatilityStruct 

Source
pub struct VolatilityStruct { /* private fields */ }
Expand description

An opaque type representing the layout of a given type within the guest OS

Can be obtained via the type_from_name function.

Note: This type is opaque due to having an undefined layout and thus may only be accessed behind a reference.

Implementations§

Source§

impl VolatilityStruct

Source

pub fn size(&self) -> target_ulong

Get the size of the given type in bytes

Source

pub fn offset_of(&self, field: &str) -> target_long

Get the offset of a given field within the structure given the name of the field

Source

pub fn type_of(&self, field: &str) -> String

Get the type of a given field within the structure given the name of the field

Source

pub fn name(&self) -> String

Get the name of a the struct

Note: this requires an O(n) reverse lookup and is not efficient. Limit usage when possible.

Source

pub fn fields(&self) -> VolatilityFieldIter<'_>

Iterate over the fields of the given struct

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, 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.