Struct sans_io_runtime::TaskGroup
source · 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)
pub fn on_event(&mut self, now: Instant, index: usize, input: In)
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, 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<(usize, Out)> for TaskGroup<In, Out, T, STACK_SIZE>
impl<In, Out, T: Task<In, Out>, const STACK_SIZE: usize> TaskSwitcherChild<(usize, Out)> for TaskGroup<In, Out, T, STACK_SIZE>
source§fn pop_output(&mut self, now: Self::Time) -> Option<(usize, Out)>
fn pop_output(&mut self, now: Self::Time) -> Option<(usize, Out)>
Retrieves the output from the flagged processed task.
type Time = <T as TaskSwitcherChild<Out>>::Time
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