1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#[cfg(feature = "alloc")]
use crate::queue::AsyncQueue;
use crate::queue::{Queue, TryQueue};
#[cfg(feature = "alloc")]
use alloc::boxed::Box;
#[cfg(feature = "alloc")]
use async_trait::async_trait;
pub trait TryPeekQueue: TryQueue {
type Peeked;
fn try_peek(&self) -> Option<Self::Peeked>;
}
pub trait PeekQueue: Queue + TryPeekQueue {
fn peek(&self) -> Self::Peeked;
}
#[cfg(feature = "alloc")]
#[async_trait]
pub trait AsyncPeekQueue: AsyncQueue + TryPeekQueue {
async fn peek_async(&self) -> Self::Peeked;
}