1#![deny(missing_docs)]
10#![cfg_attr(not(feature = "std"), no_std)]
11#![warn(missing_docs)]
12#![allow(clippy::module_name_repetitions)]
13#![allow(clippy::new_without_default)]
14#![allow(clippy::len_without_is_empty)]
15#![allow(clippy::borrowed_box)]
16#![allow(clippy::new_ret_no_self)]
17
18#[cfg(not(feature = "std"))]
19extern crate alloc;
20
21pub mod platform;
23
24pub mod error;
26pub mod executor;
27pub mod memory;
28pub mod pool;
29pub mod scheduler;
30pub mod task;
31
32#[cfg(feature = "std")]
34pub mod channel;
35
36#[cfg(feature = "coroutine")]
39pub mod coroutine;
40
41#[cfg(feature = "std")]
42pub mod communication;
43
44#[cfg(all(any(unix, windows), feature = "std"))]
45pub mod ipc;
46
47pub use error::{ExecutorError, PlacementFailure, SchedulerError, TaskError};
49pub use executor::{ExecutorConfig, TaskManager, TaskSpawner, TaskStatus, WorkerPlacement};
50pub use scheduler::SchedulerId;
51pub use task::{Priority, Task, TaskBuilder, TaskContext, TaskExt, TaskFuture, TaskHandle, TaskId};
52
53#[cfg(feature = "std")]
58pub use channel::{
59 Channel, ChannelConfig, ChannelError, ChannelStatistics, Consumer, DEFAULT_CHANNEL_CAPACITY,
60 MpmcChannel, MpmcReceiver, MpmcSender, Producer, Select, SpscConsumer, SpscProducer,
61 SpscReceiver, SpscRing, SpscSender, UnifiedReceiver, UnifiedSender, mpmc, spsc,
62 unified_channel, unified_channel_with_config,
63};
64
65pub use moirai_utils::CacheAligned;
67
68#[cfg(feature = "coroutine")]
69pub use coroutine::{
70 Coroutine, CoroutineExt, CoroutineFuture, CoroutineIterator, CoroutineResult, CoroutineState,
71 FunctionCoroutine,
72};
73
74pub use platform::{Arc, Box, String, Vec};
76
77pub type BoxError = Box<dyn core::error::Error + Send + Sync>;
79
80pub type Result<T> = core::result::Result<T, BoxError>;
82
83pub mod prelude {
85 pub use crate::{
86 ExecutorError, Priority, SchedulerError, SchedulerId, Task, TaskContext, TaskError,
87 TaskExt, TaskFuture, TaskId, TaskManager, TaskSpawner, TaskStatus,
88 };
89
90 #[cfg(feature = "std")]
91 pub use crate::{
92 Channel, ChannelError, Consumer, DEFAULT_CHANNEL_CAPACITY, MpmcReceiver, MpmcSender,
93 Producer, SpscConsumer, SpscProducer, SpscReceiver, SpscRing, SpscSender, mpmc, spsc,
94 };
95}