[][src]Trait gluon_vm::thread::ThreadInternal

pub trait ThreadInternal: Sized where
    Self: Borrow<Thread>, 
{ fn context(&self) -> OwnedContext;
fn root_value<'vm, T>(&'vm self, value: Variants) -> RootedValue<T>
    where
        T: VmRoot<'vm>
;
#[must_use] 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
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn execute_io<'life0, 'life1, 'async_trait>(
        &'life0 self,
        value: Variants<'life1>
    ) -> Pin<Box<dyn Future<Output = Result<RootedValue<RootedThread>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: '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 set_global(
        &self,
        name: Symbol,
        typ: ArcType,
        metadata: Arc<Metadata>,
        value: &Value
    ) -> Result<()>;
fn deep_clone_value(
        &self,
        owner: &Thread,
        value: &Value
    ) -> Result<RootedValue<&Thread>>;
fn can_share_values_with(&self, gc: &mut Gc, other: &Thread) -> bool; #[must_use] 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,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... }
#[must_use] 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,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: Sync + 'async_trait
, { ... } }

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

Required methods

fn context(&self) -> OwnedContext

Locks and retrives this threads stack

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

Roots a value

#[must_use]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
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Evaluates a zero argument function (a thunk)

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

Executes an IO action

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 set_global(
    &self,
    name: Symbol,
    typ: ArcType,
    metadata: Arc<Metadata>,
    value: &Value
) -> Result<()>

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

owner is theread that owns value which is not necessarily the same as self

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

Loading content...

Provided methods

#[must_use]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,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: Sync + 'async_trait, 

#[must_use]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,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: Sync + 'async_trait, 

Loading content...

Implementors

impl ThreadInternal for Thread[src]

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

Roots a value

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

Calls a module, allowed to to run IO expressions

fn call_function<'b>(
    &'b self,
    cx: &mut Context,
    context: OwnedContext<'b>,
    args: VmIndex
) -> Poll<Result<Option<OwnedContext<'b>>>>
[src]

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

Loading content...