Skip to main content

Store

Struct Store 

Source
pub struct Store<T = ()> { /* private fields */ }
Expand description

Lightweight Wasmtime-style store wrapper for VM state and host context data.

Implementations§

Source§

impl<T> Store<T>

Source

pub fn new(vm: Vm, data: T) -> Self

Source

pub fn vm(&self) -> &Vm

Source

pub fn vm_mut(&mut self) -> &mut Vm

Source

pub fn into_vm(self) -> Vm

Source

pub fn data(&self) -> &T

Source

pub fn data_mut(&mut self) -> &mut T

Source

pub fn into_data(self) -> T

Source

pub fn run(&mut self) -> VmResult<VmStatus>

Source

pub fn resume(&mut self) -> VmResult<VmStatus>

Source

pub fn set_fuel(&mut self, fuel: u64)

Source

pub fn clear_fuel(&mut self)

Source

pub fn set_fuel_check_interval(&mut self, interval: u32) -> VmResult<()>

Source

pub fn fuel_check_interval(&self) -> u32

Source

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

Source

pub fn add_fuel(&mut self, fuel: u64) -> VmResult<()>

Source

pub fn recharge(&mut self, fuel: u64) -> VmResult<()>

Source

pub fn consume_fuel(&mut self, fuel: u64) -> VmResult<()>

Source

pub fn consume_fuel_tick(&mut self) -> VmResult<()>

Source

pub fn epoch_handle(&self) -> EpochHandle

Source

pub fn current_epoch(&self) -> u64

Source

pub fn increment_epoch(&self) -> u64

Source

pub fn increment_epoch_by(&self, delta: u64) -> u64

Source

pub fn set_epoch_deadline(&mut self, ticks_beyond_current: u64) -> VmResult<()>

Source

pub fn clear_epoch_deadline(&mut self)

Source

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

Source

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

Source

pub fn set_epoch_check_interval(&mut self, interval: u32) -> VmResult<()>

Source

pub fn epoch_check_interval(&self) -> u32

Source

pub fn consume_epoch_tick(&mut self) -> VmResult<()>

Source

pub fn epoch_checkpoint(&self) -> EpochCheckpoint

Source

pub fn restore_epoch(&mut self, checkpoint: EpochCheckpoint)

Source

pub fn fuel_checkpoint(&self) -> FuelCheckpoint

Source

pub fn checkpoint(&self) -> FuelCheckpoint

Source

pub fn restore_fuel(&mut self, checkpoint: FuelCheckpoint)

Source

pub fn restore_checkpoint(&mut self, checkpoint: FuelCheckpoint)

Source§

impl Store<()>

Source

pub fn from_vm(vm: Vm) -> Self

Auto Trait Implementations§

§

impl<T = ()> !RefUnwindSafe for Store<T>

§

impl<T = ()> !Sync for Store<T>

§

impl<T = ()> !UnwindSafe for Store<T>

§

impl<T> Freeze for Store<T>
where T: Freeze,

§

impl<T> Send for Store<T>
where T: Send,

§

impl<T> Unpin for Store<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Store<T>
where T: UnsafeUnpin,

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.