reth_network_p2p/
priority.rs

1/// `BlockHeader` and `BodyHeader` `DownloadRequest` priority
2#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
3pub enum Priority {
4    /// Queued from the back for download requests.
5    #[default]
6    Normal,
7
8    /// Queued from the front for download requests.
9    High,
10}
11
12impl Priority {
13    /// Returns `true` if this is [`Priority::High`]
14    pub const fn is_high(&self) -> bool {
15        matches!(self, Self::High)
16    }
17
18    /// Returns `true` if this is [`Priority::Normal`]
19    pub const fn is_normal(&self) -> bool {
20        matches!(self, Self::Normal)
21    }
22}