pub struct TaskContainer { /* private fields */ }Implementations§
Source§impl TaskContainer
impl TaskContainer
Sourcepub fn new(id_factory: TaskIdFactory) -> Self
pub fn new(id_factory: TaskIdFactory) -> Self
Creates a new task container. Tasks can not be registered until a project has been shared with the task container.
pub fn register_task<T: Task + Send + Sync + Debug + 'static>( &mut self, id: &str, ) -> ProjectResult<TaskHandle<T>>
pub fn register_task_with<T: Task + Send + Sync + Debug + 'static, F: 'static + Send + FnOnce(&mut Executable<T>, &Project) -> ProjectResult>( &mut self, id: &str, config: F, ) -> ProjectResult<TaskHandle<T>>
Sourcepub fn get_tasks(&self) -> impl IntoIterator<Item = &TaskId>
pub fn get_tasks(&self) -> impl IntoIterator<Item = &TaskId>
Get all tasks registered to this task container
Sourcepub fn get_task(&self, id: &TaskId) -> Option<&AnyTaskHandle>
pub fn get_task(&self, id: &TaskId) -> Option<&AnyTaskHandle>
Get a task
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TaskContainer
impl !RefUnwindSafe for TaskContainer
impl Send for TaskContainer
impl Sync for TaskContainer
impl Unpin for TaskContainer
impl !UnwindSafe for TaskContainer
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
Source§impl<T> InstanceOf for T
impl<T> InstanceOf for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more