Skip to main content

externally_driven_async_rt/
not_enough_resources.rs

1/// An error returned if statically allocated resources are not enough.
2#[derive(Debug, Clone, Copy, PartialEq, Eq)]
3pub enum NotEnoughResources {
4    /// Not enough TASKS
5    Tasks,
6    /// Not enough TIMERS
7    Timers,
8    /// Not enough FDS
9    FDs,
10}
11
12impl core::fmt::Display for NotEnoughResources {
13    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
14        match self {
15            Self::Tasks => f.write_str("all task slots are taken"),
16            Self::Timers => f.write_str("all timer slots are taken"),
17            Self::FDs => f.write_str("all fd slots are taken"),
18        }
19    }
20}
21
22impl core::error::Error for NotEnoughResources {}