pub struct AsyncWasmCallState { /* private fields */ }
Expand description

Opaque state used to persist the state of the CallThreadState activations associated with a fiber stack that’s used as part of an async wasm call.

Implementations§

source§

impl AsyncWasmCallState

source

pub fn new() -> AsyncWasmCallState

Creates new state that initially starts as null.

source

pub unsafe fn push(self) -> PreviousAsyncWasmCallState

Pushes the saved state of this wasm’s call onto the current thread’s state.

This will iterate over the linked list of states stored within self and push them sequentially onto the current thread’s activation list.

The returned PreviousAsyncWasmCallState captures the state of this thread just before this operation, and it must have its restore method called to restore the state when the async wasm is suspended from.

Unsafety

Must be carefully coordinated with PreviousAsyncWasmCallState::restore and fiber switches to ensure that this doesn’t push stale data and the data is popped appropriately.

source

pub fn assert_null(&self)

Performs a runtime check that this state is indeed null.

source

pub fn assert_current_state_not_in_range(range: Range<usize>)

Asserts that the current CallThreadState pointer, if present, is not in the range specified.

This is used when exiting a future in Wasmtime to assert that the current CallThreadState pointer does not point within the stack we’re leaving (e.g. allocated for a fiber).

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.