base_scheduler/
spawn_error.rs1use std::fmt;
5
6#[derive(Clone, Copy, Debug, Eq, PartialEq)]
8pub enum SpawnError {
9 SchedulerClosed,
11 IdentifiersExhausted,
13}
14
15impl fmt::Display for SpawnError {
16 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
17 formatter.write_str(match self {
18 Self::SchedulerClosed => "the scheduler is closed",
19 Self::IdentifiersExhausted => "task identifiers are exhausted",
20 })
21 }
22}
23
24impl std::error::Error for SpawnError {}
25
26#[cfg(test)]
27mod tests;