Trait gluon_vm::thread::ThreadInternal
source · pub trait ThreadInternal: Sized{
// 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§
sourcefn context(&self) -> OwnedContext<'_>
fn context(&self) -> OwnedContext<'_>
Locks and retrives this threads stack
sourcefn root_value<'vm, T>(&'vm self, value: Variants<'_>) -> RootedValue<T>where
T: VmRoot<'vm>,
fn root_value<'vm, T>(&'vm self, value: Variants<'_>) -> RootedValue<T>where
T: VmRoot<'vm>,
Roots a value
sourcefn 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 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)
sourcefn 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 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
sourcefn call_function<'b>(
&'b self,
cx: &mut Context<'_>,
stack: OwnedContext<'b>,
args: VmIndex
) -> Poll<Result<Option<OwnedContext<'b>>>>
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
fn resume(&self, cx: &mut Context<'_>) -> Poll<Result<OwnedContext<'_>>>
fn deep_clone_value( &self, owner: &Thread, value: &Value ) -> Result<RootedValue<&Thread>>
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>>
fn execute_io_top<'life0, 'life1, 'async_trait>( &'life0 self, value: Variants<'life1> ) -> Pin<Box<dyn Future<Output = Result<RootedValue<RootedThread>>> + Send + 'async_trait>>
Object Safety§
This trait is not object safe.