Struct kannon::task::group::Group [−][src]
pub struct Group { /* fields omitted */ }
Task group unit.
Implementations
impl Group
[src]
impl Group
[src]pub fn name(&self) -> String
[src]
Get the name of the group.
pub fn handle(&self) -> GroupHandle
[src]
Get new handle item of the group.
#[must_use]pub fn create_task(
&mut self,
name: &str,
f: impl Fn() + Sync + Send + 'static
) -> Result<Task, TaskError>
[src]
&mut self,
name: &str,
f: impl Fn() + Sync + Send + 'static
) -> Result<Task, TaskError>
Create task which is binding lambda closure.
Given name must be valid and not empty. It’s ok to be duplicated with other task’s name.
#[must_use]pub fn create_task_method<T, F>(
&mut self,
name: &str,
t: &T,
f: F
) -> Result<Task, TaskError> where
T: 'static,
F: Fn(&T) + Sync + Send + 'static,
[src]
&mut self,
name: &str,
t: &T,
f: F
) -> Result<Task, TaskError> where
T: 'static,
F: Fn(&T) + Sync + Send + 'static,
Create task which is binding item’s pointer and valid immutable method from the item.
Given name must be valid and not empty. It’s ok to be duplicated with other task’s name. Being binded item should not be invalidated, or moved state. Otherwise, calling invalidated item’s method will be undefined behavior.
Calling method of task may not invalidate borrowing rule, but care about synchronization and data race manually in the logic.
#[must_use]pub fn create_task_method_mut<T, F>(
&mut self,
name: &str,
t: &mut T,
f: F
) -> Result<Task, TaskError> where
T: 'static,
F: Fn(&mut T) + Sync + Send + 'static,
[src]
&mut self,
name: &str,
t: &mut T,
f: F
) -> Result<Task, TaskError> where
T: 'static,
F: Fn(&mut T) + Sync + Send + 'static,
Create task which is binding item’s pointer and valid mutable method from the item.
Given name must be valid and not empty. It’s ok to be duplicated with other task’s name. Being binded item should not be invalidated, or moved state. Otherwise, calling invalidated item’s immutable method will be undefined behavior.
Calling method of task may not invalidate borrowing rule, but care about synchronization and data race manually in the logic.
pub fn precede(&mut self, handle: GroupHandle) -> Result<(), TaskError>
[src]
Let this group precede given other group.
If function is successful, this group will be processed before other group.
pub fn succeed(&mut self, handle: GroupHandle) -> Result<(), TaskError>
[src]
Let this group succeeds given other group.
If function is successful, this group will follow after other group.
Auto Trait Implementations
impl RefUnwindSafe for Group
impl RefUnwindSafe for Group
impl UnwindSafe for Group
impl UnwindSafe for Group