Trait gluon_vm::thread::ThreadInternal
[−]
[src]
pub trait ThreadInternal where &'a Self: Deref<Target=Thread> { fn context(&self) -> OwnedContext; fn root<'vm, T: Userdata>(&'vm self,
v: GcPtr<Box<Userdata>>)
-> Option<Root<'vm, T>>; fn root_string<'vm>(&'vm self, ptr: GcStr) -> RootStr<'vm>; fn root_value(&self, value: Value) -> RootedValue<RootedThread>; fn root_value_ref(&self, value: Value) -> RootedValue<&Thread>; fn add_bytecode(&self,
name: &str,
typ: ArcType,
args: VmIndex,
instructions: Vec<Instruction>)
-> Result<()>; fn call_thunk(&self,
closure: GcPtr<ClosureData>)
-> FutureValue<Execute<&Self>>; fn execute_io(&self, value: Value) -> FutureValue<Execute<&Self>>; fn call_function<'b>(&'b self,
stack: OwnedContext<'b>,
args: VmIndex)
-> Result<Async<Option<OwnedContext<'b>>>>; fn resume(&self) -> Result<Async<OwnedContext>>; fn global_env(&self) -> &Arc<GlobalVmState>; fn set_global(&self,
name: Symbol,
typ: ArcType,
metadata: Metadata,
value: Value)
-> Result<()>; fn deep_clone_value(&self, owner: &Thread, value: Value) -> Result<Value>; fn can_share_values_with(&self, gc: &mut Gc, other: &Thread) -> bool; }
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<'vm, T: Userdata>(&'vm self,
v: GcPtr<Box<Userdata>>)
-> Option<Root<'vm, T>>
v: GcPtr<Box<Userdata>>)
-> Option<Root<'vm, T>>
Roots a userdata
fn root_string<'vm>(&'vm self, ptr: GcStr) -> RootStr<'vm>
Roots a string
fn root_value(&self, value: Value) -> RootedValue<RootedThread>
Roots a value
fn root_value_ref(&self, value: Value) -> RootedValue<&Thread>
Roots a value
fn add_bytecode(&self,
name: &str,
typ: ArcType,
args: VmIndex,
instructions: Vec<Instruction>)
-> Result<()>
name: &str,
typ: ArcType,
args: VmIndex,
instructions: Vec<Instruction>)
-> Result<()>
fn call_thunk(&self, closure: GcPtr<ClosureData>) -> FutureValue<Execute<&Self>>
Evaluates a zero argument function (a thunk)
fn execute_io(&self, value: Value) -> FutureValue<Execute<&Self>>
Executes an IO
action
fn call_function<'b>(&'b self,
stack: OwnedContext<'b>,
args: VmIndex)
-> Result<Async<Option<OwnedContext<'b>>>>
stack: OwnedContext<'b>,
args: VmIndex)
-> Result<Async<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) -> Result<Async<OwnedContext>>
fn global_env(&self) -> &Arc<GlobalVmState>
fn set_global(&self,
name: Symbol,
typ: ArcType,
metadata: Metadata,
value: Value)
-> Result<()>
name: Symbol,
typ: ArcType,
metadata: Metadata,
value: Value)
-> Result<()>
fn deep_clone_value(&self, owner: &Thread, value: Value) -> Result<Value>
owner
is theread that owns value
which is not necessarily the same as self
Implementors
impl ThreadInternal for Thread