pub struct VmContext<DL>where
DL: CellDataProvider,{
pub base_cycles: Arc<AtomicU64>,
pub message_box: Arc<Mutex<Vec<Message>>>,
pub snapshot2_context: Arc<Mutex<Snapshot2Context<DataPieceId, SgData<DL>>>>,
}
Expand description
Mutable data at virtual machine level
Fields§
§base_cycles: Arc<AtomicU64>
Cycles executed before current VM starts
message_box: Arc<Mutex<Vec<Message>>>
A mutable reference to scheduler’s message box
snapshot2_context: Arc<Mutex<Snapshot2Context<DataPieceId, SgData<DL>>>>
A snapshot for COW usage
Implementations§
Source§impl<DL> VmContext<DL>where
DL: CellDataProvider + Clone,
impl<DL> VmContext<DL>where
DL: CellDataProvider + Clone,
Sourcepub fn new(sg_data: &SgData<DL>, message_box: &Arc<Mutex<Vec<Message>>>) -> Self
pub fn new(sg_data: &SgData<DL>, message_box: &Arc<Mutex<Vec<Message>>>) -> Self
Creates a new VM context. It is by design that parameters to this function are references. It is a reminder that the inputs are designed to be shared among different entities.
Sourcepub fn set_base_cycles(&mut self, base_cycles: u64)
pub fn set_base_cycles(&mut self, base_cycles: u64)
Sets current base cycles
Trait Implementations§
Auto Trait Implementations§
impl<DL> Freeze for VmContext<DL>
impl<DL> RefUnwindSafe for VmContext<DL>
impl<DL> Send for VmContext<DL>
impl<DL> Sync for VmContext<DL>
impl<DL> Unpin for VmContext<DL>
impl<DL> UnwindSafe for VmContext<DL>
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§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