Skip to main content

dope_core/executor/task/wait/
capacity.rs

1use std::mem;
2
3/// Maximum number of callers in a bounded wait queue.
4#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5#[repr(transparent)]
6pub struct Capacity(usize);
7
8impl Capacity {
9    pub const fn new(waiters: usize) -> Self {
10        Self(waiters)
11    }
12
13    pub const fn get(self) -> usize {
14        self.0
15    }
16}
17
18const _: () = assert!(mem::size_of::<Capacity>() == mem::size_of::<usize>());