pub trait LuaSchedulerExt {
// Required methods
fn set_exit_code(&self, code: u8);
fn push_thread_front(
&self,
thread: impl IntoLuaThread,
args: impl IntoLuaMulti,
) -> LuaResult<ThreadId>;
fn push_thread_back(
&self,
thread: impl IntoLuaThread,
args: impl IntoLuaMulti,
) -> LuaResult<ThreadId>;
fn track_thread(&self, id: ThreadId);
fn get_thread_result(
&self,
id: ThreadId,
) -> Option<LuaResult<LuaMultiValue>>;
fn wait_for_thread(&self, id: ThreadId) -> impl Future<Output = ()>;
}Expand description
Required Methods§
Sourcefn set_exit_code(&self, code: u8)
fn set_exit_code(&self, code: u8)
Sets the exit code of the current scheduler.
See Scheduler::set_exit_code for more information.
§Panics
Panics if called outside of a running Scheduler.
Sourcefn push_thread_front(
&self,
thread: impl IntoLuaThread,
args: impl IntoLuaMulti,
) -> LuaResult<ThreadId>
fn push_thread_front( &self, thread: impl IntoLuaThread, args: impl IntoLuaMulti, ) -> LuaResult<ThreadId>
Pushes (spawns) a lua thread to the front of the current scheduler.
See Scheduler::push_thread_front for more information.
§Panics
Panics if called outside of a running Scheduler.
Sourcefn push_thread_back(
&self,
thread: impl IntoLuaThread,
args: impl IntoLuaMulti,
) -> LuaResult<ThreadId>
fn push_thread_back( &self, thread: impl IntoLuaThread, args: impl IntoLuaMulti, ) -> LuaResult<ThreadId>
Pushes (defers) a lua thread to the back of the current scheduler.
See Scheduler::push_thread_back for more information.
§Panics
Panics if called outside of a running Scheduler.
Sourcefn track_thread(&self, id: ThreadId)
fn track_thread(&self, id: ThreadId)
Registers the given thread to be tracked within the current scheduler.
Must be called before waiting for a thread to complete or getting its result.
Sourcefn get_thread_result(&self, id: ThreadId) -> Option<LuaResult<LuaMultiValue>>
fn get_thread_result(&self, id: ThreadId) -> Option<LuaResult<LuaMultiValue>>
Gets the result of the given thread.
See Scheduler::get_thread_result for more information.
§Panics
Panics if called outside of a running Scheduler.
Sourcefn wait_for_thread(&self, id: ThreadId) -> impl Future<Output = ()>
fn wait_for_thread(&self, id: ThreadId) -> impl Future<Output = ()>
Waits for the given thread to complete.
See Scheduler::wait_for_thread for more information.
§Panics
Panics if called outside of a running Scheduler.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.