Skip to main content

Parameterized

Struct Parameterized 

Source
pub struct Parameterized<F, P> { /* private fields */ }
Expand description

A task that accepts parameters for customized execution.

This provides a way to create reusable task templates that can be parameterized at execution time.

Implementations§

Source§

impl<F, P> Parameterized<F, P>

Source

pub fn new(func: F, params: P, context: TaskContext) -> Parameterized<F, P>

Create a new parameterized task.

Trait Implementations§

Source§

impl<F, P, R> Task for Parameterized<F, P>
where F: FnOnce(P) -> R + Send + 'static, P: Send + 'static, R: Send + 'static,

Source§

type Output = R

The output type produced by this task.
Source§

fn execute(self) -> <Parameterized<F, P> as Task>::Output

Execute this task to completion.
Source§

fn context(&self) -> &TaskContext

Get the task context for scheduling and debugging.
Source§

fn is_stealable(&self) -> bool

Check if this task can be stolen by another thread.
Source§

fn estimated_cost(&self) -> u32

Estimate the computational cost of this task (for load balancing).

Auto Trait Implementations§

§

impl<F, P> Freeze for Parameterized<F, P>
where Option<F>: Freeze, Option<P>: Freeze,

§

impl<F, P> RefUnwindSafe for Parameterized<F, P>

§

impl<F, P> Send for Parameterized<F, P>
where Option<F>: Send, Option<P>: Send,

§

impl<F, P> Sync for Parameterized<F, P>
where Option<F>: Sync, Option<P>: Sync,

§

impl<F, P> Unpin for Parameterized<F, P>
where Option<F>: Unpin, Option<P>: Unpin,

§

impl<F, P> UnsafeUnpin for Parameterized<F, P>

§

impl<F, P> UnwindSafe for Parameterized<F, P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> TaskExt for T
where T: Task,

Source§

fn map<F, R>(self, mapper: F) -> Mapped<Self, F>
where F: FnOnce(Self::Output) -> R,

Transform the output of this task.
Source§

fn with_context(self, context: TaskContext) -> ContextualTask<Self>

Convert this task into a task with the given context.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.