Struct SimpleJitState
pub struct SimpleJitState<'a, A: Arch> { /* private fields */ }
Expand description
A simple just-in-time CPU state, that replaces a fixed set of state bytes with the correct value.
Each derived state must change a specific subset of bytes, so this structure is unsuitable if many different state bytes might be changed.
In that case, use super::ComplexJitState
instead.
Implementations§
§impl<'a, A: Arch> SimpleJitState<'a, A>
impl<'a, A: Arch> SimpleJitState<'a, A>
pub fn build<'ret, M: MappableArea>(
bytes_affected: &'ret [StateByte],
state_gen: &'ret StateGen<'a, A, M>,
view: SystemStateByteView<'a, A>,
base_state: &'ret SystemState<A>,
create: impl FnMut(usize, &mut SystemState<A>) -> bool + 'ret,
num: usize,
) -> impl Iterator<Item = SimpleJitState<'a, A>> + 'retwhere
'a: 'ret,
pub fn build<'ret, M: MappableArea>(
bytes_affected: &'ret [StateByte],
state_gen: &'ret StateGen<'a, A, M>,
view: SystemStateByteView<'a, A>,
base_state: &'ret SystemState<A>,
create: impl FnMut(usize, &mut SystemState<A>) -> bool + 'ret,
num: usize,
) -> impl Iterator<Item = SimpleJitState<'a, A>> + 'retwhere
'a: 'ret,
Creates a new JIT state. All returned states will use the same underlying base state.
The affected bytes must be pre-determined.
Panics in debug mode when any bytes outside the bytes_affected
list are modified.
Trait Implementations§
§impl<A: Arch> AsSystemState<A> for SimpleJitState<'_, A>
impl<A: Arch> AsSystemState<A> for SimpleJitState<'_, A>
§type Output<'a> = SimpleStateRef<'a, A>
where
Self: 'a
type Output<'a> = SimpleStateRef<'a, A> where Self: 'a
The output type of
Self::as_system_state
.§fn as_system_state(&self) -> Self::Output<'_>
fn as_system_state(&self) -> Self::Output<'_>
Returns a type that implements
AsRef<SystemState<A>>
.
Should be a cheap operation, as it may be called often.§fn num_memory_mappings(&self) -> usize
fn num_memory_mappings(&self) -> usize
Returns the number of memory mappings in the state that
Self::as_system_state
will return.§impl<'a, A: Clone + Arch> Clone for SimpleJitState<'a, A>
impl<'a, A: Clone + Arch> Clone for SimpleJitState<'a, A>
§fn clone(&self) -> SimpleJitState<'a, A>
fn clone(&self) -> SimpleJitState<'a, A>
Returns a copy 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 more§impl<'j, A: Arch> From<SimpleJitState<'j, A>> for MaybeJitState<'j, A>
impl<'j, A: Arch> From<SimpleJitState<'j, A>> for MaybeJitState<'j, A>
§fn from(value: SimpleJitState<'j, A>) -> Self
fn from(value: SimpleJitState<'j, A>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a, A> Freeze for SimpleJitState<'a, A>
impl<'a, A> !RefUnwindSafe for SimpleJitState<'a, A>
impl<'a, A> !Send for SimpleJitState<'a, A>
impl<'a, A> !Sync for SimpleJitState<'a, A>
impl<'a, A> Unpin for SimpleJitState<'a, A>
impl<'a, A> !UnwindSafe for SimpleJitState<'a, A>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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>
Converts
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>
Converts
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