Struct kannon::task::group::Group[][src]

pub struct Group { /* fields omitted */ }

Task group unit.

Implementations

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]

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]

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]

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 Send for Group

impl Sync for Group

impl Unpin for Group

impl UnwindSafe for Group

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.