Skip to main content

Module tasks

Module tasks 

Source
Expand description

§Task Function Module

Provides zero-argument task-oriented functional abstractions.

Callable represents a reusable computation that returns Result<R, E>. Runnable represents a reusable action that returns Result<(), E>. Both abstractions are intentionally fallible and support task submission in executor-style workflows. CallableWith and RunnableWith are their mutable-input counterparts for executor APIs that pass protected state into the task.

One-time equivalents are also provided as CallableOnce and RunnableOnce for move-only callable use cases.

§Author

Haixing Hu

Re-exports§

pub use callable::ArcCallable;
pub use callable::BoxCallable;
pub use callable::Callable;
pub use callable::RcCallable;
pub use callable_once::BoxCallableOnce;
pub use callable_once::CallableOnce;
pub use callable_with::ArcCallableWith;
pub use callable_with::BoxCallableWith;
pub use callable_with::CallableWith;
pub use callable_with::RcCallableWith;
pub use runnable::ArcRunnable;
pub use runnable::BoxRunnable;
pub use runnable::RcRunnable;
pub use runnable::Runnable;
pub use runnable_once::BoxRunnableOnce;
pub use runnable_once::RunnableOnce;
pub use runnable_with::ArcRunnableWith;
pub use runnable_with::BoxRunnableWith;
pub use runnable_with::RcRunnableWith;
pub use runnable_with::RunnableWith;

Modules§

callable
Callable Types
callable_once
Callable Once Types
callable_with
CallableWith Types
runnable
Runnable Types
runnable_once
Runnable Once Types
runnable_with
RunnableWith Types