pub trait ThreadInternal: Sized
where Self: Borrow<Thread>,
{ // Required methods fn context(&self) -> OwnedContext<'_>; fn root_value<'vm, T>(&'vm self, value: Variants<'_>) -> RootedValue<T> where T: VmRoot<'vm>; fn call_thunk<'life0, 'life1, 'async_trait>( &'life0 self, closure: &'life1 GcPtr<ClosureData> ) -> Pin<Box<dyn Future<Output = Result<RootedValue<RootedThread>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn execute_io<'life0, 'life1, 'async_trait>( &'life0 self, value: Variants<'life1> ) -> Pin<Box<dyn Future<Output = Result<RootedValue<RootedThread>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn call_function<'b>( &'b self, cx: &mut Context<'_>, stack: OwnedContext<'b>, args: VmIndex ) -> Poll<Result<Option<OwnedContext<'b>>>>; fn resume(&self, cx: &mut Context<'_>) -> Poll<Result<OwnedContext<'_>>>; fn deep_clone_value( &self, owner: &Thread, value: &Value ) -> Result<RootedValue<&Thread>>; fn can_share_values_with(&self, gc: &mut Gc, other: &Thread) -> bool; // Provided methods fn call_thunk_top<'life0, 'life1, 'async_trait>( &'life0 self, closure: &'life1 GcPtr<ClosureData> ) -> Pin<Box<dyn Future<Output = Result<RootedValue<RootedThread>>> + Send + 'async_trait>> where Self: Send + Sync + Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn execute_io_top<'life0, 'life1, 'async_trait>( &'life0 self, value: Variants<'life1> ) -> Pin<Box<dyn Future<Output = Result<RootedValue<RootedThread>>> + Send + 'async_trait>> where Self: Send + Sync + Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } }
Expand description

Internal functions for interacting with threads. These functions should be considered both unsafe and unstable.

Required Methods§

source

fn context(&self) -> OwnedContext<'_>

Locks and retrives this threads stack

source

fn root_value<'vm, T>(&'vm self, value: Variants<'_>) -> RootedValue<T>
where T: VmRoot<'vm>,

Roots a value

source

fn call_thunk<'life0, 'life1, 'async_trait>( &'life0 self, closure: &'life1 GcPtr<ClosureData> ) -> Pin<Box<dyn Future<Output = Result<RootedValue<RootedThread>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Evaluates a zero argument function (a thunk)

source

fn execute_io<'life0, 'life1, 'async_trait>( &'life0 self, value: Variants<'life1> ) -> Pin<Box<dyn Future<Output = Result<RootedValue<RootedThread>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executes an IO action

source

fn call_function<'b>( &'b self, cx: &mut Context<'_>, stack: OwnedContext<'b>, args: VmIndex ) -> Poll<Result<Option<OwnedContext<'b>>>>

Calls a function on the stack. When this function is called it is expected that the function exists at stack.len() - args - 1 and that the arguments are of the correct type

source

fn resume(&self, cx: &mut Context<'_>) -> Poll<Result<OwnedContext<'_>>>

source

fn deep_clone_value( &self, owner: &Thread, value: &Value ) -> Result<RootedValue<&Thread>>

source

fn can_share_values_with(&self, gc: &mut Gc, other: &Thread) -> bool

Provided Methods§

source

fn call_thunk_top<'life0, 'life1, 'async_trait>( &'life0 self, closure: &'life1 GcPtr<ClosureData> ) -> Pin<Box<dyn Future<Output = Result<RootedValue<RootedThread>>> + Send + 'async_trait>>
where Self: Send + Sync + Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn execute_io_top<'life0, 'life1, 'async_trait>( &'life0 self, value: Variants<'life1> ) -> Pin<Box<dyn Future<Output = Result<RootedValue<RootedThread>>> + Send + 'async_trait>>
where Self: Send + Sync + Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§