pub struct TaskGroup<In, Out, T: Task<In, Out>, const STACK_SIZE: usize> { /* private fields */ }
Expand description
Represents a group of tasks.
Implementations§
Source§impl<In, Out, T: Task<In, Out>, const STACK_SIZE: usize> TaskGroup<In, Out, T, STACK_SIZE>
impl<In, Out, T: Task<In, Out>, const STACK_SIZE: usize> TaskGroup<In, Out, T, STACK_SIZE>
Sourcepub fn remove_task(&mut self, index: usize)
pub fn remove_task(&mut self, index: usize)
Remove a task from the group
Sourcepub fn on_tick(&mut self, now: Instant)
pub fn on_tick(&mut self, now: Instant)
Fire tick event to all tasks, after that we need to call pop_output util it return None
Sourcepub fn on_event(&mut self, now: Instant, index: usize, input: In) -> Option<()>
pub fn on_event(&mut self, now: Instant, index: usize, input: In) -> Option<()>
Send event to correct task with index
Sourcepub fn on_shutdown(&mut self, now: Instant)
pub fn on_shutdown(&mut self, now: Instant)
Gracefully destroys the task group.
Trait Implementations§
Source§impl<In: Debug, Out: Debug, T: Debug + Task<In, Out>, const STACK_SIZE: usize> Debug for TaskGroup<In, Out, T, STACK_SIZE>
impl<In: Debug, Out: Debug, T: Debug + Task<In, Out>, const STACK_SIZE: usize> Debug for TaskGroup<In, Out, T, STACK_SIZE>
Source§impl<In, Out, T: Task<In, Out>, const STACK_SIZE: usize> Default for TaskGroup<In, Out, T, STACK_SIZE>
impl<In, Out, T: Task<In, Out>, const STACK_SIZE: usize> Default for TaskGroup<In, Out, T, STACK_SIZE>
Source§impl<In, Out, T: Task<In, Out>, const STACK_SIZE: usize> TaskSwitcherChild<TaskGroupOutput<Out>> for TaskGroup<In, Out, T, STACK_SIZE>
impl<In, Out, T: Task<In, Out>, const STACK_SIZE: usize> TaskSwitcherChild<TaskGroupOutput<Out>> for TaskGroup<In, Out, T, STACK_SIZE>
Source§fn pop_output(&mut self, now: Self::Time) -> Option<TaskGroupOutput<Out>>
fn pop_output(&mut self, now: Self::Time) -> Option<TaskGroupOutput<Out>>
Retrieves the output from the flagged processed task.
type Time = <T as TaskSwitcherChild<Out>>::Time
fn empty_event(&self) -> TaskGroupOutput<Out>
fn is_empty(&self) -> bool
Auto Trait Implementations§
impl<In, Out, T, const STACK_SIZE: usize> Freeze for TaskGroup<In, Out, T, STACK_SIZE>where
T: Freeze,
impl<In, Out, T, const STACK_SIZE: usize> RefUnwindSafe for TaskGroup<In, Out, T, STACK_SIZE>
impl<In, Out, T, const STACK_SIZE: usize> Send for TaskGroup<In, Out, T, STACK_SIZE>
impl<In, Out, T, const STACK_SIZE: usize> Sync for TaskGroup<In, Out, T, STACK_SIZE>
impl<In, Out, T, const STACK_SIZE: usize> Unpin for TaskGroup<In, Out, T, STACK_SIZE>
impl<In, Out, T, const STACK_SIZE: usize> UnwindSafe for TaskGroup<In, Out, T, STACK_SIZE>
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