tokio_util/time/wheel/
stack.rs1use std::borrow::Borrow;
2use std::cmp::Eq;
3use std::hash::Hash;
4
5pub(crate) trait Stack: Default {
7 type Owned: Borrow<Self::Borrowed>;
9
10 type Borrowed: Eq + Hash;
12
13 type Store;
15
16 fn is_empty(&self) -> bool;
18
19 fn push(&mut self, item: Self::Owned, store: &mut Self::Store);
21
22 fn pop(&mut self, store: &mut Self::Store) -> Option<Self::Owned>;
24
25 fn peek(&self) -> Option<Self::Owned>;
27
28 fn remove(&mut self, item: &Self::Borrowed, store: &mut Self::Store);
29
30 fn when(item: &Self::Borrowed, store: &Self::Store) -> u64;
31}