Skip to main content

Group

Struct Group 

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

A collection of related tasks that can be executed as a group.

This provides batch execution capabilities and allows for coordinated task management and monitoring.

Implementations§

Source§

impl Group

Source

pub fn new(id: TaskId) -> Group

Creates a new task group with the specified ID.

§Arguments
  • id - Unique identifier for the task group
§Returns

A new empty task group

Source

pub fn add_task<F>(&mut self, task_fn: F)
where F: FnOnce() + Send + 'static,

Add a task to the group.

Source

pub fn len(&self) -> usize

Returns the number of tasks in this group.

§Returns

The count of tasks currently in the group

Source

pub fn is_empty(&self) -> bool

Checks if the task group is empty.

§Returns

true if the group contains no tasks, false otherwise

Trait Implementations§

Source§

impl Task for Group

Source§

type Output = ()

The output type produced by this task.
Source§

fn execute(self) -> <Group as Task>::Output

Execute this task to completion.
Source§

fn context(&self) -> &TaskContext

Get the task context for scheduling and debugging.
Source§

fn estimated_cost(&self) -> u32

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

fn is_stealable(&self) -> bool

Check if this task can be stolen by another thread.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Group

§

impl !Sync for Group

§

impl !UnwindSafe for Group

§

impl Freeze for Group

§

impl Send for Group

§

impl Unpin for Group

§

impl UnsafeUnpin for Group

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.