pub struct TaskOptions { /* private fields */ }Implementations§
Source§impl TaskOptions
impl TaskOptions
Sourcepub fn new_extern<P: WasmParams + 'static>(
pool: &mut TaskPool,
host: &Host,
task_start: u32,
args: P,
) -> Result<Self>
pub fn new_extern<P: WasmParams + 'static>( pool: &mut TaskPool, host: &Host, task_start: u32, args: P, ) -> Result<Self>
Create options for a task who’s entrypoint is a function from robot code.
§Arguments
pool- The task pool to create the task in.host- The host to use for the task.task_start- The index of the task entrypoint in the task table. Function pointers are transformed into indices in the__indirect_function_tableby the linker.args- The arguments to pass to the task entrypoint.
Sourcepub fn new_closure(
pool: &mut TaskPool,
host: &Host,
task_closure: impl for<'a> FnOnce(Caller<'a, Host>) -> Box<dyn Future<Output = Result<()>> + Send + 'a> + Send + 'static,
) -> Result<Self>
pub fn new_closure( pool: &mut TaskPool, host: &Host, task_closure: impl for<'a> FnOnce(Caller<'a, Host>) -> Box<dyn Future<Output = Result<()>> + Send + 'a> + Send + 'static, ) -> Result<Self>
Create options for a task who’s entrypoint is a custom closure created by the host. These are treated the same as “real” tasks that have entrypoints in robot code.
Sourcepub fn new_global(
pool: &mut TaskPool,
host: &Host,
func_name: &'static str,
) -> Result<Self>
pub fn new_global( pool: &mut TaskPool, host: &Host, func_name: &'static str, ) -> Result<Self>
Create options for a task who’s entrypoint is a global function from robot code.
pub fn name(self, name: impl Into<String>) -> Self
pub fn priority(self, priority: u32) -> Self
Auto Trait Implementations§
impl Freeze for TaskOptions
impl !RefUnwindSafe for TaskOptions
impl Send for TaskOptions
impl Sync for TaskOptions
impl Unpin for TaskOptions
impl !UnwindSafe for TaskOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more