Skip to main content

BlockView

Struct BlockView 

Source
pub struct BlockView<'a> {
    pub ctx: &'a Context<'static>,
    pub block: BlockId,
}
Expand description

A read-only look at a block, for choosing sites.

Fields§

§ctx: &'a Context<'static>§block: BlockId

Implementations§

Source§

impl BlockView<'_>

Source

pub fn address(&self) -> Option<u64>

The block’s guest address, if it starts at one.

Source

pub fn entry(&self) -> Option<Site>

The site at the block’s entry, if the block starts at a guest address.

Anchored on the first instruction that is not an interrupt an earlier hook placed at the entry, so hooks on the same entry fire in registration order and a hook recognises its own anchor when asked again.

Source

pub fn addresses(&self) -> Vec<Site>

Every guest instruction that starts in the block, in order, as a site on the first instruction lifted from it.

One guest instruction’s p-code may branch within itself, so a block with no address of its own can open with the tail of an instruction begun in its predecessor. Those instructions carry the predecessor’s last address; they are a continuation, not a start, and get no site.

Source

pub fn at(&self, address: u64) -> Option<Site>

The instruction addressed by the guest instruction at address, as a site, if the block covers it.

Source

pub fn stores(&self) -> Vec<Site>

Every store to guest memory, in order.

Source

pub fn loads(&self) -> Vec<Site>

Every load from guest memory, in order.

Source

pub fn compares(&self) -> Vec<Site>

Every integer comparison, in order.

Auto Trait Implementations§

§

impl<'a> Freeze for BlockView<'a>

§

impl<'a> RefUnwindSafe for BlockView<'a>

§

impl<'a> Send for BlockView<'a>

§

impl<'a> Sync for BlockView<'a>

§

impl<'a> Unpin for BlockView<'a>

§

impl<'a> UnsafeUnpin for BlockView<'a>

§

impl<'a> UnwindSafe for BlockView<'a>

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.