Skip to main content

TaskBuilder

Struct TaskBuilder 

Source
pub struct TaskBuilder { /* private fields */ }
Expand description

Builder for creating and configuring tasks.

Implementations§

Source§

impl TaskBuilder

Source

pub fn new() -> TaskBuilder

Creates a new task builder with default settings.

§Returns

A new builder instance ready for configuration

Source

pub fn priority(self, priority: Priority) -> TaskBuilder

Sets the priority level for the task.

§Arguments
  • priority - The scheduling priority for this task
§Returns

The builder instance for method chaining

Source

pub fn name(self, name: &'static str) -> TaskBuilder

Sets a descriptive name for the task.

§Arguments
  • name - A static string name for debugging and monitoring
§Returns

The builder instance for method chaining

Source

pub fn with_id(self, id: TaskId) -> TaskBuilder

Sets the task ID and returns the modified task builder.

§Arguments
  • id - The unique identifier for this task
§Returns

The task builder with the specified ID set

Source

pub fn build<F, R>(self, func: F) -> Closure<F, R>
where F: FnOnce() -> R + Send + 'static, R: Send + 'static,

Build the task with the provided function.

Trait Implementations§

Source§

impl Default for TaskBuilder

Source§

fn default() -> TaskBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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, 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.